name: Release Artifacts
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
target: aarch64-apple-darwin
- os: macos-14
target: x86_64-apple-darwin
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
- os: windows-2022
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install ARM64 linker
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Set linker for ARM64
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: Swatinem/rust-cache@v2
- name: Build axhash-ffi
run: cargo build --release --target ${{ matrix.target }} -p axhash-ffi
- name: Package release archive
run: python scripts/package-release.py "${{ matrix.target }}" release "$PWD/dist"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: axhash-${{ matrix.target }}
path: dist/*
if-no-files-found: error
retention-days: 14
release:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Inspect collected artifacts
run: |
echo "Collected files:"
ls -lh dist/
- name: Compute SHA256 checksums
working-directory: dist
run: |
sha256sum * > SHA256SUMS.txt
echo "---"
cat SHA256SUMS.txt
- name: Create GitHub Release with all artifacts
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
fail_on_unmatched_files: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}