Skip to content

Workflow file for this run

name: Build and Release Binaries
on:
release:
types:
- published
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- 'ubuntu-latest'
- 'macos-latest'
- 'windows-latest'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Apply caching
uses: swatinem/rust-cache@v2
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build binary
run: |
cargo build --release
env:
CARGO_BUILD_TARGET: ${{ matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'x86_64-unknown-linux-gnu' || 'x86_64-apple-darwin' }}
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-binary
path: target/release/${{ github.event.repository.name }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: binaries
- name: Upload release binaries
uses: softprops/action-gh-release@v2
with:
files: binaries/*