56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: aarch64-apple-darwin
|
|
os: macos-14
|
|
- target: x86_64-apple-darwin
|
|
os: macos-14
|
|
- target: x86_64-unknown-linux-musl
|
|
os: ubuntu-latest
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Add target + musl tooling
|
|
run: |
|
|
rustup target add ${{ matrix.target }}
|
|
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]; then
|
|
sudo apt-get update && sudo apt-get install -y musl-tools
|
|
fi
|
|
|
|
- name: Build
|
|
run: cargo build --release --locked --target ${{ matrix.target }}
|
|
|
|
- name: Package
|
|
run: |
|
|
TAR="matcha-${{ matrix.target }}.tar.gz"
|
|
tar -czf "$TAR" -C "target/${{ matrix.target }}/release" matcha
|
|
if command -v sha256sum >/dev/null 2>&1; then
|
|
sha256sum "$TAR" > "$TAR.sha256"
|
|
else
|
|
shasum -a 256 "$TAR" > "$TAR.sha256"
|
|
fi
|
|
|
|
- name: Upload to release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
matcha-${{ matrix.target }}.tar.gz
|
|
matcha-${{ matrix.target }}.tar.gz.sha256
|