Files
mcp/.hanzo/workflows/release.yml
T
zeekay b8436102e1
Hanzo CI/CD / test (linux-amd64) (push) Skipped
Hanzo CI/CD / test (linux-arm64) (push) Skipped
Hanzo CI/CD / test-advisory (push) Skipped
publish / publish (push) Successful in 3m10s
Hanzo CI/CD / test-amd64 (push) Successful in 4m55s
Hanzo CI/CD / cicd (push) Successful in 3m50s
CI/CD / cicd (push) Successful in 8m49s
release: build only the targets that compile
The Windows leg fails at zapd, whose ZAP router and native host speak a
Unix socket, so every release carried a red job. Linux and macOS on
both architectures are what hanzo-mcp ships.

Claude-Session: https://claude.ai/code/session_01M8RoubcPN71KgJuZ8LdBUL
2026-10-14 21:42:49 -07:00

118 lines
4.8 KiB
YAML

# Builds the hanzo-mcp binary for every target the installer offers, and
# attaches each with its checksum.
#
# There was no such lane. hanzo.yml declares a TypeScript gate and publish.yml
# ships the npm package; neither produces a binary, so the tarballs on the
# rust-v1.1.23 release arrived some other way and only ever covered Linux.
# hanzo.sh offers `mcp` as a native download, so Linux and macOS on both
# architectures are built here. Windows is not: the browser bridge (zapd) and
# its native host speak a Unix socket, and the build stops there.
#
# Tagged rust-v*, because the binary is the Rust crate in rust/ — its
# Cargo.toml is the one that calls itself hanzo-mcp.
#
# .hanzo/workflows, with every other pipeline in this repository. The forge
# reads the FIRST of .hanzo/workflows and .github/workflows that exists, so a
# file left in the other directory is a pipeline that never runs.
name: release
on:
push:
tags: ['rust-v*']
workflow_dispatch:
permissions:
contents: write
env:
ZIG_VERSION: '0.13.0'
ZIG_SHA256: 'd45312e61ebcc48032b77bc4cf7fd6915c11fa16e4aad116b66c9468211230ea'
ZIGBUILD_VERSION: '0.23.0'
MACOS_SDK_URL: 'https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz'
MACOS_SDK_SHA256: 'cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4'
jobs:
# The release has to exist before anything can be attached to it, and five
# matrix jobs racing to create it is four failures and a coin toss. One job,
# first, and the builds wait on it.
open:
runs-on: linux-amd64
steps:
# The runner image carries no gh CLI; the release action speaks the API.
- uses: softprops/action-gh-release@v2
with:
name: hanzo-mcp ${{ github.ref_name }}
generate_release_notes: true
build:
needs: open
strategy:
# One target failing leaves the others published rather than the release
# empty. A missing target is a missing file somebody can chase; a missing
# release is an install that breaks for everyone.
fail-fast: false
# One at a time: five cross-builds on one runner host's disk at once is
# what the CLI's matrix measured taking the host down.
max-parallel: 1
matrix:
include:
- { target: linux-amd64, triple: x86_64-unknown-linux-gnu, bin: hanzo-mcp }
- { target: linux-arm64, triple: aarch64-unknown-linux-gnu, bin: hanzo-mcp }
- { target: darwin-amd64, triple: x86_64-apple-darwin, bin: hanzo-mcp, apple: true }
- { target: darwin-arm64, triple: aarch64-apple-darwin, bin: hanzo-mcp, apple: true }
runs-on: linux-amd64
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.triple }}
# Every target is cross-linked by Zig from this one Linux pool, as the CLI's
# release is: no macOS or Windows runner exists, and none is needed.
- name: Zig (the cross-linker)
run: |
set -eu
curl -fsSL "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz" -o zig.tar.xz
echo "${ZIG_SHA256} zig.tar.xz" | sha256sum -c -
mkdir -p "$HOME/zig"
tar -xf zig.tar.xz -C "$HOME/zig" --strip-components=1
echo "$HOME/zig" >> "$GITHUB_PATH"
- name: cargo-zigbuild
run: cargo install cargo-zigbuild --version "${ZIGBUILD_VERSION}" --locked
# Zig ships no macOS frameworks (cocoa and objc link AppKit), so a pinned
# SDK is vendored and SDKROOT names it.
- name: Vendor macOS SDK
if: matrix.apple
run: |
set -eu
curl -fsSL "${MACOS_SDK_URL}" -o macsdk.tar.xz
echo "${MACOS_SDK_SHA256} macsdk.tar.xz" | sha256sum -c -
tar -xf macsdk.tar.xz -C "$HOME"
echo "SDKROOT=$HOME/MacOSX11.3.sdk" >> "$GITHUB_ENV"
- name: Build
working-directory: rust
run: cargo zigbuild --release --locked --bin hanzo-mcp --target "${{ matrix.triple }}"
# The name the installer asks for, and the checksum it refuses to install
# without. Both are part of the contract in hanzo.sh, not decoration.
- name: Package
run: |
set -eu
asset="hanzo-mcp-${{ matrix.target }}.tar.gz"
tar -C "rust/target/${{ matrix.triple }}/release" -czf "$asset" "${{ matrix.bin }}"
# "<hash> <name>", the line `sha256sum -c` reads: install.sh verifies
# the download with exactly that, and a bare hash fails it.
sha256sum "$asset" > "$asset.sha256"
ls -l "$asset" "$asset.sha256"
- name: Attach
uses: softprops/action-gh-release@v2
with:
files: |
hanzo-mcp-${{ matrix.target }}.tar.gz
hanzo-mcp-${{ matrix.target }}.tar.gz.sha256