Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
56ae2e47fThis file is pinned to the selected release. Download the original to open it in your design tool.
name: Release harness tui
# Build and publish `harness-tui`, the native terminal client `harness tui` launches (tui/ at the repo
# root). One static binary per platform — Linux ones are musl, so the same file runs on any distro a
# person can SSH into — uploaded next to the CLI in the same bucket, with a manifest the CLI's
# `harness tui --install` reads and checksum-verifies (cli/src/tui/index.ts):
#
# harness/tui/metadata.json { version, builds: { "<os>-<arch>": { url, sha256 } } }
#
# gh workflow run release-tui.yml # build + publish
# gh workflow run release-tui.yml -f publish=false # build only, inspect the artifacts
on:
workflow_dispatch:
inputs:
publish:
description: 'Upload the binaries and rewrite harness/tui/metadata.json'
type: boolean
default: true
permissions:
contents: read
id-token: write # Workload Identity Federation for the GCS steps, as release-tmux-runtime.yml
env:
GCS_BUCKET: s3-autonomous-upgrade-3
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- name: Unit tests
working-directory: tui
run: cargo test --locked
# The real binary, driven in tmux against tests/mock-daemon.mjs: no account, no real harnesses.
- uses: actions/setup-node@v4
with:
node-version: 22
- name: End-to-end against the mock daemon
run: |
set -euo pipefail
sudo apt-get update && sudo apt-get install -y tmux
(cd cli && npm ci --no-audit --no-fund)
(cd tui && cargo build --locked --release)
tui/tests/e2e.sh
- name: Native terminal lifecycle and concurrent window creation
run: python3 -u tui/tests/native-terminal.py
build:
needs: test
strategy:
fail-fast: true
matrix:
include:
- { platform: darwin-arm64, os: macos-15, target: aarch64-apple-darwin }
- { platform: darwin-x64, os: macos-15, target: x86_64-apple-darwin }
- { platform: linux-x64, os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { platform: linux-arm64, os: ubuntu-24.04-arm, target: aarch64-unknown-linux-musl }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: musl toolchain
if: contains(matrix.target, 'musl')
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build ${{ matrix.platform }}
working-directory: tui
run: |
set -euo pipefail
cargo build --locked --release --target ${{ matrix.target }}
mkdir -p "$RUNNER_TEMP/dist"
cp target/${{ matrix.target }}/release/harness-tui "$RUNNER_TEMP/dist/harness-tui-${{ matrix.platform }}"
bin="$RUNNER_TEMP/dist/harness-tui-${{ matrix.platform }}"
# A binary that cannot even say its version is not shipped (the x64 macOS one runs under Rosetta).
"$bin" --version
{
echo "### harness-tui · ${{ matrix.platform }}"
echo '```'
echo "size $(wc -c < "$bin" | tr -d ' ') bytes"
echo "sha256 $(shasum -a 256 "$bin" | awk '{print $1}')"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v4
with:
name: harness-tui-${{ matrix.platform }}
path: ${{ runner.temp }}/dist/harness-tui-${{ matrix.platform }}
if-no-files-found: error
retention-days: 14
publish:
if: ${{ inputs.publish }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v4
with:
pattern: harness-tui-*
path: dist
merge-multiple: true
- name: Authenticate to GCP (workload identity federation)
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- uses: google-github-actions/setup-gcloud@v2
- name: Publish binaries and manifest
run: |
set -euo pipefail
version="$(grep -m1 '^version' tui/Cargo.toml | cut -d'"' -f2)"
base="harness/tui/${version}"
builds="{}"
for bin in dist/harness-tui-*; do
platform="${bin##*/harness-tui-}"
sha="$(sha256sum "$bin" | awk '{print $1}')"
# `gcloud storage`, never gsutil — gsutil cannot use the federated credential.
gcloud storage cp "$bin" "gs://${GCS_BUCKET}/${base}/harness-tui-${platform}" --cache-control="public, max-age=31536000, immutable"
url="https://storage.googleapis.com/${GCS_BUCKET}/${base}/harness-tui-${platform}"
builds="$(jq -c --arg p "$platform" --arg u "$url" --arg s "$sha" '. + {($p): {url: $u, sha256: $s}}' <<< "$builds")"
done
jq -n --arg v "$version" --argjson b "$builds" '{version: $v, builds: $b}' > metadata.json
cat metadata.json
gcloud storage cp metadata.json "gs://${GCS_BUCKET}/harness/tui/metadata.json" --cache-control="no-cache, max-age=0"
echo "Published harness-tui **${version}** → \`https://storage.googleapis.com/${GCS_BUCKET}/harness/tui/metadata.json\`" >> "$GITHUB_STEP_SUMMARY"