name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build for ${{ matrix.target }}
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
artifact_name: seela-x86_64
- target: aarch64-unknown-linux-gnu
artifact_name: seela-aarch64
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build
run: |
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
fi
cargo build --release --target ${{ matrix.target }}
- name: Strip binary
run: |
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
aarch64-linux-gnu-strip target/${{ matrix.target }}/release/seela
else
strip target/${{ matrix.target }}/release/seela
fi
- name: Rename artifact
run: cp target/${{ matrix.target }}/release/seela ${{ matrix.artifact_name }}
- name: Calculate checksum
run: |
sha256sum ${{ matrix.artifact_name }} | cut -d' ' -f1 > ${{ matrix.artifact_name }}.sha256
- name: Upload binaries to release
uses: softprops/action-gh-release@v2
with:
files: |
${{ matrix.artifact_name }}
${{ matrix.artifact_name }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}