name: Release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: linux
- os: windows-latest
target: x86_64-pc-windows-msvc
name: windows
- os: macos-latest
target: x86_64-apple-darwin
name: macos-intel
- os: macos-latest
target: aarch64-apple-darwin
name: macos-arm
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
mv target/${{ matrix.target }}/release/ghsi.exe ghsi-${{ matrix.name }}.exe
echo "ASSET=ghsi-${{ matrix.name }}.exe" >> $GITHUB_ENV
else
mv target/${{ matrix.target }}/release/ghsi ghsi-${{ matrix.name }}
echo "ASSET=ghsi-${{ matrix.name }}" >> $GITHUB_ENV
fi
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.ASSET }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}