name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build release binaries
run: |
# Linux x86_64
cargo build --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/rss-proxy rss-proxy-x86_64-unknown-linux-gnu
# macOS universal (build for both targets)
rustup target add x86_64-apple-darwin aarch64-apple-darwin
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
# Windows
rustup target add x86_64-pc-windows-msvc
cargo build --release --target x86_64-pc-windows-msvc
- name: Package binaries
run: |
# Linux x86_64
tar -czf rss-proxy-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz rss-proxy-x86_64-unknown-linux-gnu
# macOS binaries
tar -czf rss-proxy-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz target/x86_64-apple-darwin/release/rss-proxy
tar -czf rss-proxy-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz target/aarch64-apple-darwin/release/rss-proxy
# Windows
cp target/x86_64-pc-windows-msvc/release/rss-proxy.exe rss-proxy-${{ github.ref_name }}-x86_64-pc-windows-msvc.exe
zip rss-proxy-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip rss-proxy-${{ github.ref_name }}-x86_64-pc-windows-msvc.exe
- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
rss-proxy-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
rss-proxy-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
rss-proxy-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
rss-proxy-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip