name: Release
on:
release:
types: [created]
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: committer-linux-x86_64
binary: committer
- os: macos-latest
target: x86_64-apple-darwin
artifact: committer-macos-x86_64
binary: committer
- os: macos-latest
target: aarch64-apple-darwin
artifact: committer-macos-aarch64
binary: committer
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact: committer-windows-x86_64.exe
binary: committer.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Rename binary
shell: bash
run: |
cp target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.artifact }}
- name: Upload to release
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.artifact }}