Skip to content

ci: Add automated release workflow for Linux/Windows/macOS #1

ci: Add automated release workflow for Linux/Windows/macOS

ci: Add automated release workflow for Linux/Windows/macOS #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-and-upload:
name: Build ${{ matrix.asset_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux (Musl/Static)
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: vwh
asset_name: vwh-linux-amd64
use_cross: true
# Windows (Standard)
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: vwh.exe
asset_name: vwh-windows-amd64.exe
use_cross: false
# macOS (Apple Silicon - ARM64)
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: vwh
asset_name: vwh-macos-arm64
use_cross: false
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Cross
if: matrix.use_cross
run: cargo install cross
- name: Build (Native)
if: matrix.use_cross == false
run: cargo build --release --target ${{ matrix.target }} --package vwh
- name: Build (Cross)
if: matrix.use_cross
run: cross build --release --target ${{ matrix.target }} --package vwh
- name: Rename Asset
shell: bash
run: |
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.asset_name }}