biscuit-auth 6.0.0 #43
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: 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 | |
| - os: ubuntu-latest | |
| target_arch: aarch64-unknown-linux-gnu | |
| arch: arm64-linux | |
| - os: windows-latest | |
| target_arch: x86_64-pc-windows-msvc | |
| arch: x86_64-windows | |
| - os: windows-latest | |
| target_arch: i686-pc-windows-msvc | |
| arch: i686-windows | |
| - os: windows-latest | |
| target_arch: aarch64-pc-windows-msvc | |
| arch: arm64-windows | |
| 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 | |
| echo "RUSTFLAGS=-C target-feature=-crt-static" >> $GITHUB_ENV | |
| - name: Install linux arm toolchain | |
| if: matrix.os == 'ubuntu-latest' && matrix.target_arch == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt install -y gcc-aarch64-linux-gnu | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
| - 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.13 | |
| run: | | |
| curl -L $LINK/$CARGO_C_VERSION/$CARGO_C_FILE -o ${{ env.CARGO_C_FILE }} | |
| unzip ${{ env.CARGO_C_FILE }} -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.13 | |
| run: | | |
| curl -L $LINK/$CARGO_C_VERSION/$CARGO_C_FILE | tar xz -C ~/.cargo/bin | |
| - name: Install cargo-c (Windows) | |
| if: matrix.os == 'windows-latest' | |
| env: | |
| LINK: https://github.com/lu-zero/cargo-c/releases/download | |
| CARGO_C_FILE: cargo-c-windows-msvc.zip | |
| CARGO_C_VERSION: v0.10.13 | |
| shell: cmd | |
| run: | | |
| curl -L %LINK%/%CARGO_C_VERSION%/%CARGO_C_FILE% -o %TEMP%\%CARGO_C_FILE% | |
| tar xzf %TEMP%\%CARGO_C_FILE% -C %USERPROFILE%\.cargo\bin | |
| del %TEMP%\%CARGO_C_FILE% | |
| - 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 | |
| shell: bash | |
| run: | | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| # Don't use --prefix on Windows, as there is no global location to install shared libraries and headers. | |
| cargo cinstall --target ${{ matrix.target_arch }} \ | |
| --destdir=./build \ | |
| --profile release-strip | |
| else | |
| cargo cinstall --target ${{ matrix.target_arch }} \ | |
| --prefix=/usr \ | |
| --destdir=./build \ | |
| --profile release-strip | |
| fi | |
| - name: Compress | |
| run: tar cvzf biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz -C build/ . | |
| - name: Generate checksum | |
| shell: bash | |
| run: | | |
| if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "Windows" ]]; 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 |