Skip to content
This repository was archived by the owner on Jan 10, 2026. It is now read-only.

Build and Publish Rust CLI #6

Build and Publish Rust CLI

Build and Publish Rust CLI #6

Workflow file for this run

name: Build and Publish Rust CLI
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
release:
name: release ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
os: windows-latest
archive: zip
extension: .exe
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
archive: zip
extension: ""
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
archive: zip
extension: ""
- target: x86_64-apple-darwin
os: macos-13
archive: zip
extension: ""
- target: aarch64-apple-darwin
os: macos-latest
archive: zip
extension: ""
steps:
- uses: actions/checkout@master
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-22.04-arm'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: musl-tools
version: 1.0
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.85.0
target: ${{ matrix.target }}
- name: Compile
id: compile
run: |
cargo build --release --target ${{ matrix.target }}
- name: Create zip archive
id: zip_release
run: |
mkdir -p release
cp target/${{ matrix.target }}/release/moodriver${{ matrix.extension }} release/
cd release
zip -r moodriver-${{ matrix.target }}.zip moodriver${{ matrix.extension }}
echo "ARCHIVE_PATH=release/moodriver-${{ matrix.target }}.zip" >> $GITHUB_OUTPUT
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ steps.zip_release.outputs.ARCHIVE_PATH }}