Skip to content

v0.2.1

v0.2.1 #28

Workflow file for this run

---
name: Build
on:
release:
types: [published]
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
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
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
run: cargo build --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_NAME}"
"${ARCHIVE_FILENAME}"
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}