name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Release ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: wsup
asset_name: wsup-linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: wsup.exe
asset_name: wsup-windows-x86_64.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: wsup
asset_name: wsup-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: wsup
asset_name: wsup-macos-aarch64
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: Strip binary (Linux and macOS)
if: matrix.os != 'windows-latest'
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true
prerelease: true
body: |
v0.1.1 - Windows support
Now works on Windows, macOS, and Linux.