summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcyqsimon <28627918+cyqsimon@users.noreply.github.com>2023-09-19 18:25:22 +0800
committercyqsimon <28627918+cyqsimon@users.noreply.github.com>2023-09-19 18:25:22 +0800
commit14298fc569e8baeb559e1eaeb8fb8c4abe0a8b47 (patch)
treee8a8c6e027d61543f9ea35cab7cc07c19ca05afe
parent448152ce1a3b1c8ec9464aa4d7102b121d362232 (diff)
Always use `github.ref_name` for version numberv0.21.0
-rw-r--r--.github/workflows/release.yaml20
1 files changed, 8 insertions, 12 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 8fcd326..3569b52 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -34,8 +34,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- tag_name: ${{ github.event_name == 'workflow_dispatch' && '' || github.ref }}
- release_name: Release ${{ github.event_name == 'workflow_dispatch' && 'main' || github.ref }}
+ tag_name: ${{ github.ref_name }}
+ release_name: Release ${{ github.ref_name }}
# draft: ${{ github.event_name == 'workflow_dispatch' }}
draft: true
prerelease: false
@@ -72,10 +72,6 @@ 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:
@@ -96,12 +92,12 @@ jobs:
- name: Tar release (unix)
if: matrix.os != 'windows-latest'
working-directory: ./target/${{ matrix.target }}/release
- run: tar cvfz bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.tar.gz "bandwhich"
+ run: tar cvfz bandwhich-${{ github.ref_name }}-${{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-${{ steps.release-version.outputs.v }}-${{matrix.target}}.zip "bandwhich.exe"
+ run: tar.exe -a -c -f bandwhich-${{ github.ref_name }}-${{matrix.target}}.zip "bandwhich.exe"
- name: Upload release archive (unix)
if: matrix.os != 'windows-latest'
@@ -110,8 +106,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
- asset_path: ./target/${{ matrix.target }}/release/bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.tar.gz
- asset_name: bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.tar.gz
+ asset_path: ./target/${{ matrix.target }}/release/bandwhich-${{ github.ref_name }}-${{matrix.target}}.tar.gz
+ asset_name: bandwhich-${{ github.ref_name }}-${{matrix.target}}.tar.gz
asset_content_type: application/octet-stream
- name: Upload Windows release archive
@@ -121,6 +117,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
- asset_path: ./target/${{ matrix.target }}/release/bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.zip
- asset_name: bandwhich-${{ steps.release-version.outputs.v }}-${{matrix.target}}.zip
+ asset_path: ./target/${{ matrix.target }}/release/bandwhich-${{ github.ref_name }}-${{matrix.target}}.zip
+ asset_name: bandwhich-${{ github.ref_name }}-${{matrix.target}}.zip
asset_content_type: application/octet-stream