Skip to content

Commit

Permalink
ci(capi): Add MUSL Support + SHA256 checksums
Browse files Browse the repository at this point in the history
  • Loading branch information
ptondereau committed Nov 3, 2024
1 parent 6ccb7aa commit 05b7fde
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,28 @@ jobs:
strategy:
matrix:
include:
# deactivated for now, the x86 workers are more expensive
# - os: macos-latest-large
# target_arch: x86_64-apple-darwin
- 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
use_musl: true

steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install musl tools
if: matrix.use_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 }}
Expand All @@ -36,11 +47,25 @@ jobs:
- 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
- name: Build C-API (standard)
run: cargo cinstall --release --prefix=/usr --destdir=./build --features="capi"
- name: Build C-API (musl)
if: matrix.use_musl
run: |
cargo cinstall --target ${{ matrix.target_arch }} --release --prefix=/usr --destdir=./build --features="capi"
- name: Compress
run: tar cvzf biscuit_capi-${{github.ref_name}}-${{matrix.target_arch}}.tar.gz -C build/ .
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@v1
with:
files: biscuit_capi-${{github.ref_name}}-${{matrix.target_arch}}.tar.gz
files: |
biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz
biscuit-auth-${{github.ref_name}}-${{matrix.arch}}.tar.gz.sha256

0 comments on commit 05b7fde

Please sign in to comment.