diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e344a9f..ddd96b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,12 @@ on: push: tags: - 'v*' + workflow_dispatch: + inputs: + tag: + description: 'Existing tag to build and upload assets for (e.g. v0.1.0)' + required: true + type: string env: CARGO_TERM_COLOR: always @@ -11,8 +17,14 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + contents: write + env: + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} steps: - uses: actions/checkout@v4 + with: + ref: ${{ env.RELEASE_TAG }} - name: Set up Rust 1.80 uses: dtolnay/rust-toolchain@master @@ -23,6 +35,9 @@ jobs: - name: Install musl-tools run: sudo apt-get update && sudo apt-get install -y musl-tools + - name: Ensure musl target installed + run: rustup target add x86_64-unknown-linux-musl + - name: Cache cargo build uses: actions/cache@v4 with: @@ -40,7 +55,7 @@ jobs: - name: Get version from tag id: version - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + run: echo "VERSION=${{ env.RELEASE_TAG }}" >> "$GITHUB_OUTPUT" - name: Prepare release artifact run: | @@ -51,6 +66,7 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: + tag_name: ${{ steps.version.outputs.VERSION }} files: | release/pbkfs-${{ steps.version.outputs.VERSION }}-linux-x86_64 release/checksums.txt