name: release-build
on:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-build:
name: Release Build (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container || '' }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-22.04
container: quay.io/pypa/manylinux_2_28_x86_64
cache_golden_bin: false
- target: aarch64-unknown-linux-gnu
runner: ubuntu-22.04-arm
container: quay.io/pypa/manylinux_2_28_aarch64
cache_golden_bin: false
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
cache_golden_bin: true
- target: aarch64-apple-darwin
runner: macos-latest
cache_golden_bin: true
- target: x86_64-apple-darwin
runner: macos-15-intel
cache_golden_bin: false
- target: x86_64-pc-windows-msvc
runner: windows-latest
cache_golden_bin: true
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Rust non-interactively if not already installed
if: ${{ matrix.container }}
run: |
if ! command -v cargo > /dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.container }}
with:
toolchain: stable
- name: Build (release)
run: cargo build --release
- name: Prepare CLI regression golden binary
if: ${{ matrix.cache_golden_bin && runner.os != 'Windows' }}
run: |
mkdir -p target/regression-golden
cp target/release/bender target/regression-golden/bender
- name: Prepare CLI regression golden binary
if: ${{ matrix.cache_golden_bin && runner.os == 'Windows' }}
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path target/regression-golden | Out-Null
Copy-Item target/release/bender.exe target/regression-golden/bender.exe
- name: Cache CLI regression golden binary
if: ${{ matrix.cache_golden_bin }}
uses: actions/cache/save@v5
with:
path: target/regression-golden
key: golden-bender-${{ matrix.target }}-${{ github.sha }}