Skip to content

fix: disable sccache via env vars for cargo #11

fix: disable sccache via env vars for cargo

fix: disable sccache via env vars for cargo #11

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# Linux targets
- target: x86_64-unknown-linux-gnu
name: wassette
arch: linux_amd64
runner: ubuntu-latest
- target: aarch64-unknown-linux-gnu
name: wassette
arch: linux_arm64
runner: ubuntu-24.04-arm
# macOS targets
- target: x86_64-apple-darwin
name: wassette
arch: darwin_amd64
runner: macos-13
- target: aarch64-apple-darwin
name: wassette
arch: darwin_arm64
runner: macos-latest
# Windows targets
- target: x86_64-pc-windows-msvc
name: wassette
arch: windows_amd64
runner: windows-latest
- target: aarch64-pc-windows-msvc
name: wassette
arch: windows_arm64
runner: windows-11-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Sccache Action
if: matrix.target != 'aarch64-pc-windows-msvc'
uses: Mozilla-Actions/sccache-action@v0.0.9
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: Add WASM target
run: rustup target add wasm32-wasip2
- name: Build release binary
run: cargo build --release
env:
SCCACHE_GHA_ENABLED: ${{ matrix.target != 'aarch64-pc-windows-msvc' && 'true' || 'false' }}
RUSTC_WRAPPER: ${{ matrix.target != 'aarch64-pc-windows-msvc' && 'sccache' || '' }}
- name: Extract version (Unix)
if: "!contains(matrix.target, 'windows')"
id: version-unix
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Extract version (Windows)
if: contains(matrix.target, 'windows')
id: version-windows
run: |
$VERSION = "${{ github.ref_name }}" -replace '^v', ''
echo "version=$VERSION" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Set version output
id: version
run: |
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
echo "version=${{ steps.version-windows.outputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.version-unix.outputs.version }}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Prepare binary (Unix)
if: "!contains(matrix.target, 'windows')"
run: |
cd target/release
tar czvf ../../${{ matrix.name }}_${{ steps.version.outputs.version }}_${{ matrix.arch }}.tar.gz wassette
cd -
- name: Prepare binary (Windows)
if: contains(matrix.target, 'windows')
run: |
cd target/release
7z a ../../${{ matrix.name }}_${{ steps.version.outputs.version }}_${{ matrix.arch }}.zip wassette.exe
cd -
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-${{ matrix.arch }}
path: |
${{ matrix.name }}_*_${{ matrix.arch }}.tar.gz
${{ matrix.name }}_*_${{ matrix.arch }}.zip
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version
id: version
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
find artifacts -name "*.tar.gz" -exec cp {} release-assets/ \;
find artifacts -name "*.zip" -exec cp {} release-assets/ \;
ls -la release-assets/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: false
generate_release_notes: true
files: release-assets/*
body: |
## Downloads
### Linux
- [AMD64 (tar.gz)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_linux_amd64.tar.gz)
### macOS (Darwin)
- [AMD64/Intel (tar.gz)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_darwin_amd64.tar.gz)
- [ARM64/Apple Silicon (tar.gz)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_darwin_arm64.tar.gz)
### Windows
- [AMD64 (zip)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_windows_amd64.zip)
## Install
### All Platforms (Shell Script)
```bash
curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | bash
```
This will detect your platform and install the latest `wassette` binary to your `$PATH`.
## Usage
```bash
# Start the MCP server
wassette serve --http --policy-file policy.yaml
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}