From f74cc491dcb3a1a0a39114210cb49ae93925b00f Mon Sep 17 00:00:00 2001 From: Maurizio Turatti Date: Thu, 17 Oct 2024 19:52:32 +0200 Subject: [PATCH] Fix file path and name in GitHub Actions workflow [skip ci] --- .github/workflows/native-image.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/native-image.yml b/.github/workflows/native-image.yml index 6291e5cac..6794b0dbf 100644 --- a/.github/workflows/native-image.yml +++ b/.github/workflows/native-image.yml @@ -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); @@ -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