ci: bump all actions to the latest versions #37
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: Release | |
on: | |
push: | |
tags: | |
- "*" | |
permissions: | |
contents: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-capi: | |
runs-on: ${{ matrix.os }} | |
name: Build C-API (${{ matrix.arch }}) | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
target_arch: x86_64-apple-darwin | |
arch: x86_64-macos | |
- os: macos-latest | |
target_arch: aarch64-apple-darwin | |
arch: arm64-macos | |
- os: ubuntu-latest | |
target_arch: x86_64-unknown-linux-gnu | |
arch: x86_64-linux | |
- os: ubuntu-latest | |
target_arch: x86_64-unknown-linux-musl | |
arch: x86_64-linux-musl | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install musl tools | |
if: matrix.os == 'ubuntu-latest' && matrix.target_arch == 'x86_64-unknown-linux-musl' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y musl-tools | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.target_arch }} | |
- name: Install cargo-c (macOS) | |
if: matrix.os == 'macos-latest' | |
env: | |
LINK: https://github.com/lu-zero/cargo-c/releases/download | |
CARGO_C_FILE: cargo-c-macos.zip | |
CARGO_C_VERSION: v0.10.5 | |
run: | | |
curl -L $LINK/$CARGO_C_VERSION/$CARGO_C_FILE -o cargo-c-macos.zip | |
unzip cargo-c-macos.zip -d ~/.cargo/bin | |
- name: Install cargo-c (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
env: | |
LINK: https://github.com/lu-zero/cargo-c/releases/download | |
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz | |
CARGO_C_VERSION: v0.10.5 | |
run: | | |
curl -L $LINK/$CARGO_C_VERSION/$CARGO_C_FILE | tar xz -C ~/.cargo/bin | |
- name: Run cargo-c tests | |
run: cargo ctest --release --features="capi" | |
if: matrix.os == 'ubuntu-latest' && matrix.target_arch == 'x86_64-unknown-linux-gnu' | |
- name: Build C-API (Linux) | |
if: matrix.os == 'ubuntu-latest' && matrix.target_arch == 'x86_64-unknown-linux-gnu' | |
run: cargo cinstall --release --target ${{ matrix.target_arch }} --prefix=/usr --destdir=./build | |
- name: Build C-API (musl) | |
if: matrix.os == 'ubuntu-latest' && matrix.target_arch == 'x86_64-unknown-linux-musl' | |
run: | | |
cargo cinstall --target ${{ matrix.target_arch }} --release --prefix=/usr --destdir=./build | |
- name: Build C-API (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
cargo cinstall --target ${{ matrix.target_arch }} --release --prefix=/usr --destdir=./build | |
- name: Compress | |
run: tar cvzf biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz -C build/ . | |
- name: Generate checksum | |
run: | | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
sha256sum "biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz" > "biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz.sha256" | |
else | |
shasum -a 256 "biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz" > "biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz.sha256" | |
fi | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz | |
biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz.sha256 |