ci: add Rust release workflow

Added workflow to build and release binaries for Linux, macOS, and Windows on tag push.
This commit is contained in:
m1ngsama 2025-12-18 13:24:59 +08:00
parent 22cbc1d019
commit e2775b8314

47
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Build and Release for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: tracker-rs
asset_name: tracker-rs-linux-amd64
- os: windows-latest
artifact_name: tracker-rs.exe
asset_name: tracker-rs-windows-amd64.exe
- os: macos-latest
artifact_name: tracker-rs
asset_name: tracker-rs-macos-amd64
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Rename binary
shell: bash
run: |
cp target/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }}
- name: Upload to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.asset_name }}
generate_release_notes: true