Install musl tools #22
Workflow file for this run
This file contains 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: Build | |
on: push | |
permissions: | |
id-token: write | |
attestations: write | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
env: | |
COLUMNS: 120 | |
jobs: | |
cargo-build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
- target: aarch64-unknown-linux-musl | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
env: | |
ARCHIVE_FILENAME: >- | |
hanko-${{ github.ref_name }}-${{ matrix.target }}.${{ startsWith(matrix.os, 'windows') && 'zip' || 'tar.gz' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: "${{ matrix.target }}" | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install GCC for aarch64 | |
run: sudo apt install -y gcc-aarch64-linux-gnu | |
if: ${{ contains(matrix.target, 'aarch64') && contains(matrix.target, 'linux') }} | |
- name: Install musl tools | |
run: sudo apt install -y musl-tools | |
if: ${{ contains(matrix.target, 'musl') && contains(matrix.target, 'linux') }} | |
- name: Print versions | |
shell: bash | |
run: | | |
gcc --version || true | |
rustup -V | |
rustup toolchain list | |
rustup default | |
cargo -V | |
rustc -V | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --locked --target ${{ matrix.target }} | |
- name: Create Release Tar Archive | |
run: >- | |
tar -czvf "${ARCHIVE_FILENAME}" | |
-C target/${{ matrix.target }}/release | |
hanko | |
shell: bash | |
if: ${{ !startsWith(matrix.os, 'windows') }} | |
- name: Create Release Zip Archive | |
run: >- | |
7z a "${ARCHIVE_FILENAME}" | |
./target/${{ matrix.target }}/release/hanko.exe | |
shell: bash | |
if: ${{ startsWith(matrix.os, 'windows') }} | |
- name: Attest Build Provenance | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: ${{ env.ARCHIVE_FILENAME }} | |
- name: Upload Release Archive | |
run: >- | |
gh release upload "${GITHUB_REF#refs/tags/}" | |
"${ARCHIVE_FILENAME}" | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |