mirror of
https://github.com/imsnif/bandwhich.git
synced 2026-02-09 01:59:18 +08:00
CD: set correct version for binaries
This commit is contained in:
18
.github/workflows/release.yaml
vendored
18
.github/workflows/release.yaml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user