Skip to content

Commit

Permalink
Fix file path and name in GitHub Actions workflow [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
mkjsix committed Oct 17, 2024
1 parent 8e58875 commit f74cc49
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/native-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ jobs:
- name: Upload Binary to Release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs').promises;
const isWindows = 'ubuntu-latest' === 'windows-latest';
const isWindows = '${{ matrix.os }}' === 'windows-latest';
const filePath = isWindows ? 'core/target/restheart.exe' : 'core/target/restheart';
const fileName = `restheart-linux-amd64${isWindows ? '.exe' : ''}`;
const releaseTag = '8.1.0';
const fileName = `restheart-${{ matrix.arch }}${isWindows ? '.exe' : ''}`;
const releaseTag = '8.1.0'; // Consider making this an input parameter
try {
const content = await fs.readFile(filePath);
Expand Down Expand Up @@ -89,8 +88,10 @@ jobs:
console.log(`Successfully uploaded ${fileName} to release ${releaseTag}`);
} catch (error) {
console.error('Error occurred:', error.message);
core.setFailed(error.message);
process.exit(1);
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker-publish:
runs-on: ubuntu-latest
Expand Down

0 comments on commit f74cc49

Please sign in to comment.