diff options
author | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2023-09-11 17:43:22 +0800 |
---|---|---|
committer | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2023-09-11 17:43:22 +0800 |
commit | a9fbc6d4638f73bb45a8baba76d6001f022bbc32 (patch) | |
tree | 78200aa3428398a908f432b4cc5f545d7c480e78 /.github | |
parent | c72c3ea4dd33d6f999ecdfbf839751b20fd2f207 (diff) |
CD: set correct version for binaries
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/release.yaml | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6143d4e..ae3e05d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ name: release on: push: tags: - - "[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+" workflow_dispatch: jobs: @@ -70,6 +70,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - id: release-version + name: Compute version + run: echo v=${{ github.event_name == 'workflow_dispatch' && 'main' || github.ref }} >> "$GITHUB_OUTPUT" + - name: Install Rust uses: dtolnay/rust-toolchain@master with: @@ -90,12 +94,12 @@ jobs: - name: Tar release (unix) if: matrix.os != 'windows-latest' working-directory: ./target/${{ matrix.target }}/release - run: tar cvfz bandwhich-v${{ github.event.release.tag_name }}-${{matrix.target}}.tar.gz "bandwhich" + run: tar cvfz bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.tar.gz "bandwhich" - name: Zip Windows release if: matrix.os == 'windows-latest' working-directory: ./target/${{ matrix.target }}/release - run: tar.exe -a -c -f bandwhich-v${{ github.event.release.tag_name }}-${{matrix.target}}.zip "bandwhich.exe" + run: tar.exe -a -c -f bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.zip "bandwhich.exe" - name: Upload release archive (unix) if: matrix.os != 'windows-latest' @@ -104,8 +108,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ./target/${{ matrix.target }}/release/bandwhich-v${{ github.event.release.tag_name }}-${{matrix.target}}.tar.gz - asset_name: bandwhich-v${{ github.event.release.tag_name }}-${{matrix.target}}.tar.gz + asset_path: ./target/${{ matrix.target }}/release/bandwhich-v${{ steps.release-version.outputs.v }}-${{matrix.target}}.tar.gz + asset_name: bandwhich-v${{ steps.release-version.outputs.v }}-${{matrix.target}}.tar.gz asset_content_type: application/octet-stream - name: Upload Windows release archive @@ -115,6 +119,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ./target/${{ matrix.target }}/release/bandwhich-v${{ github.event.release.tag_name }}-${{matrix.target}}.zip - asset_name: bandwhich-v${{ github.event.release.tag_name }}-${{matrix.target}}.zip + asset_path: ./target/${{ matrix.target }}/release/bandwhich-v${{ steps.release-version.outputs.v }}-${{matrix.target}}.zip + asset_name: bandwhich-v${{ steps.release-version.outputs.v }}-${{matrix.target}}.zip asset_content_type: application/octet-stream |