ci: experiment with a binary release build #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: zizmor binary releases for GitHub 🐙 | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "The release to attach binaries to" | |
required: true | |
clobber: | |
description: "Whether to clobber existing files" | |
required: true | |
default: false | |
type: boolean | |
dry-run: | |
description: "Whether to perform a dry run" | |
required: true | |
default: false | |
type: boolean | |
release: | |
types: [published] | |
pull_request: | |
permissions: {} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- runner: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- runner: ubuntu-24.04-arm | |
target: aarch64-unknown-linux-gnu | |
- runner: macos-latest | |
target: x86_64-apple-darwin | |
- runner: macos-latest | |
target: aarch64-apple-darwin | |
- runner: windows-latest | |
target: x86_64-pc-windows-msvc | |
- runner: windows-latest | |
target: i686-pc-windows-msvc | |
runs-on: ${{ matrix.runner }} | |
name: Release build for ${{ matrix.target }} on ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: Rust toolchain and target information | |
run: | | |
rustup show | |
- name: Install Rust target for ${{ matrix.target }} | |
run: rustup target add "${TARGET}" | |
env: | |
TARGET: ${{ matrix.target }} | |
shell: bash | |
- name: Build release | |
run: cargo build --release --target "${TARGET}" | |
env: | |
TARGET: ${{ matrix.target }} | |
shell: bash | |
- name: Rename binary | |
run: | | |
mv ./target/${TARGET}/release/zizmor ./target/${TARGET}/release/zizmor-${TARGET} | |
env: | |
TARGET: ${{ matrix.target }} | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: artifacts-${{ matrix.target }} | |
path: ./target/${{ matrix.target }}/release/zizmor-${{ matrix.target }} | |
# - name: Upload to release | |
# if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }} | |
# run: | | |
# gh release upload ${CLOBBER} "${RELEASE_TAG}" | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }} | |
# CLOBBER: ${{ github.event.inputs.clobber && '--clobber' || '' }} | |
# shell: bash |