diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e0ef14..983c1a7 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 release tag to build and publish + required: true + type: string permissions: contents: read @@ -14,12 +20,14 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag || github.ref }} - uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - name: Validate release tag and package versions env: - RELEASE_TAG: ${{ github.ref_name }} + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} run: python3 scripts/check-release-version.py --tag "$RELEASE_TAG" - name: Check Rust workspace run: | @@ -47,6 +55,8 @@ jobs: - aarch64-unknown-linux-musl steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag || github.ref }} - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} @@ -54,7 +64,7 @@ jobs: - uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 - name: Build sc run: cross build --locked --release --target "${{ matrix.target }}" --bin sc - - name: Package binary + - name: Package and validate binary env: TARGET: ${{ matrix.target }} run: | @@ -68,7 +78,11 @@ jobs: cosign sign-blob --yes \ --bundle "dist/sc-$TARGET.tar.gz.sha256.sigstore.json" \ "dist/sc-$TARGET.tar.gz.sha256" - "target/$TARGET/release/sc" --version + if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then + "target/$TARGET/release/sc" --version + else + file "target/$TARGET/release/sc" | grep -F "ARM aarch64" + fi - uses: actions/upload-artifact@v4 with: name: sc-${{ matrix.target }} @@ -92,6 +106,7 @@ jobs: merge-multiple: true - uses: softprops/action-gh-release@v2 with: + tag_name: ${{ inputs.tag || github.ref_name }} generate_release_notes: true fail_on_unmatched_files: true files: dist/*