Skip to content

Commit

Permalink
Always use github.ref_name for version number
Browse files Browse the repository at this point in the history
  • Loading branch information
cyqsimon committed Sep 19, 2023
1 parent 448152c commit 14298fc
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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'
Expand All @@ -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
Expand All @@ -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

0 comments on commit 14298fc

Please sign in to comment.