name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build — ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Linux x86_64
target: x86_64-unknown-linux-gnu
artifact: whisrs-linux-x86_64
features: ""
- name: Linux x86_64 (no local-whisper)
target: x86_64-unknown-linux-gnu
artifact: whisrs-linux-x86_64-minimal
features: "--no-default-features"
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libxkbcommon-dev pkg-config
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --target ${{ matrix.target }} ${{ matrix.features }}
- name: Package
run: |
mkdir -p staging
cp target/${{ matrix.target }}/release/whisrs staging/
cp target/${{ matrix.target }}/release/whisrsd staging/
cp README.md LICENSE staging/
cp -r contrib staging/
cd staging
tar czf ../${{ matrix.artifact }}.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}.tar.gz
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: artifacts/*