From 850fe41b9377a3d2194fedcb92be29723e366dcd Mon Sep 17 00:00:00 2001 From: Ash Manning Date: Mon, 11 Mar 2024 16:25:20 +0800 Subject: [PATCH] WIP: use version numbers in build artifacts --- .github/workflows/check_lint_build.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_lint_build.yaml b/.github/workflows/check_lint_build.yaml index e963f07..7ef6c09 100644 --- a/.github/workflows/check_lint_build.yaml +++ b/.github/workflows/check_lint_build.yaml @@ -48,17 +48,24 @@ jobs: command: build args: --release + - name: Set version number environment variable and output filename + run: | + THUNDER_APP_VERSION=$(cargo metadata | jq -e '.packages | map(select(.name == "thunder_app") | .version) | .[0]') + OUTPUT_FILENAME="thunder-${THUNDER_APP_VERSION}-x86_64-unknown-linux-gnu" + echo "THUNDER_APP_VERSION=$THUNDER_APP_VERSION" >> "$GITHUB_ENV" + echo "OUTPUT_FILENAME=$OUTPUT_FILENAME" >> "$GITHUB_ENV" + - name: 'Set filename for release binary' run: | pushd "target/release" - mv "thunder_app" "thunder-x86_64-unknown-linux-gnu" + ln -s "thunder_app" "${OUTPUT_FILENAME}" popd - name: 'Upload Artifacts (thunder)' uses: actions/upload-artifact@v2 with: - name: thunder-x86_64-unknown-linux-gnu - path: target/release/thunder-x86_64-unknown-linux-gnu + name: ${{ env.OUTPUT_FILENAME }} + path: target/release/${{ env.OUTPUT_FILENAME }} if-no-files-found: error build-macos: