name: Release CLI
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v2026.4.6)"
required: true
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
RSCLAW_BUILD_VERSION: ${{ inputs.tag || github.ref_name }}
RSCLAW_BUILD_DATE: ${{ github.event.head_commit.timestamp || github.event.repository.updated_at }}
jobs:
build:
name: CLI ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
archive: tar.gz
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04-arm
archive: tar.gz
- target: x86_64-apple-darwin
os: macos-14
archive: tar.gz
- target: aarch64-apple-darwin
os: macos-14
archive: tar.gz
- target: x86_64-pc-windows-msvc
os: windows-latest
archive: zip
- target: aarch64-pc-windows-msvc
os: windows-latest
archive: zip
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.91"
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: cli-${{ matrix.target }}
- name: Install protoc (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install protoc (macOS)
if: runner.os == 'macOS'
run: brew install protobuf
- name: Install protoc (Windows)
if: runner.os == 'Windows'
run: choco install protoc -y
- name: Build (Unix)
if: runner.os != 'Windows'
run: cargo build --release --target ${{ matrix.target }}
- name: Build (Windows)
if: runner.os == 'Windows'
run: cargo build --release --target ${{ matrix.target }}
- name: Package (tar.gz)
if: matrix.archive == 'tar.gz'
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../rsclaw-${{ github.ref_name }}-${{ matrix.target }}.tar.gz rsclaw
cd ../../..
- name: Package (zip)
if: matrix.archive == 'zip'
shell: pwsh
run: |
Compress-Archive -Path "target/${{ matrix.target }}/release/rsclaw.exe" `
-DestinationPath "rsclaw-${{ github.ref_name }}-${{ matrix.target }}.zip"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: rsclaw-${{ matrix.target }}
path: rsclaw-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive }}
release:
name: Create CLI Release
runs-on: ubuntu-latest
needs: build
if: always() && !cancelled()
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: Generate checksums
run: |
cd artifacts
sha256sum rsclaw-* 2>/dev/null > SHA256SUMS.txt || true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag || github.ref_name }}
generate_release_notes: true
files: |
artifacts/rsclaw-*
artifacts/SHA256SUMS.txt