refactor: goose-acp-server -> goose binary for TUI (#8155)

This commit is contained in:
Alex Hancock
2026-03-27 17:12:11 -04:00
committed by GitHub
parent ae83fd2adc
commit dfa93fe948
21 changed files with 335 additions and 262 deletions
-120
View File
@@ -1,120 +0,0 @@
name: Build Native Packages
on:
workflow_call:
outputs:
artifact-name:
description: "Name of the artifact containing all native binaries"
value: ${{ jobs.collect.outputs.artifact-name }}
workflow_dispatch:
push:
branches:
- main
paths:
- 'crates/goose-acp/**'
- 'ui/acp/**'
- '.github/workflows/build-native-packages.yml'
pull_request:
paths:
- 'crates/goose-acp/**'
- 'ui/acp/**'
- '.github/workflows/build-native-packages.yml'
jobs:
build-matrix:
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- platform: darwin-arm64
os: macos-latest
target: aarch64-apple-darwin
- platform: darwin-x64
os: macos-latest
target: x86_64-apple-darwin
- platform: linux-arm64
os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- platform: linux-x64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- platform: win32-x64
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
targets: ${{ matrix.target }}
- name: Add Intel target for cross-compilation (macOS ARM64 → x86_64)
if: matrix.platform == 'darwin-x64'
run: rustup target add x86_64-apple-darwin
- name: Install cross-compilation tools (Linux ARM64)
if: matrix.platform == 'linux-arm64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Setup Rust cache
uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
with:
key: ${{ matrix.platform }}
- name: Build goose-acp-server
run: cargo build --release --target ${{ matrix.target }} --bin goose-acp-server
- name: Prepare artifact (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p artifact/bin
cp target/${{ matrix.target }}/release/goose-acp-server artifact/bin/
chmod +x artifact/bin/goose-acp-server
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
mkdir -p artifact/bin
cp target/${{ matrix.target }}/release/goose-acp-server.exe artifact/bin/
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: goose-acp-server-${{ matrix.platform }}
path: artifact/
if-no-files-found: error
retention-days: 7
collect:
name: Collect all binaries
runs-on: ubuntu-latest
needs: build-matrix
outputs:
artifact-name: native-binaries-all
steps:
- name: Download all artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: native-binaries
- name: List downloaded artifacts
run: |
echo "Downloaded artifacts:"
ls -R native-binaries/
- name: Upload combined artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: native-binaries-all
path: native-binaries/
if-no-files-found: error
retention-days: 7
+46 -22
View File
@@ -91,9 +91,9 @@ jobs:
if-no-files-found: error
retention-days: 7
# Build goose binaries for all platforms
# Build goose CLI binaries for all platforms
build-goose-binaries:
name: Build goose (${{ matrix.platform }})
name: Build goose CLI (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -111,9 +111,10 @@ jobs:
- platform: linux-x64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- platform: win32-x64
os: windows-latest
target: x86_64-pc-windows-msvc
# Temporarily disabled - Windows builds are slow (20+ min) without cache
# - platform: win32-x64
# os: windows-latest
# target: x86_64-pc-windows-msvc
outputs:
cache-key-base: ${{ steps.cache-key.outputs.key-base }}
steps:
@@ -164,7 +165,7 @@ jobs:
target/${{ matrix.target }}/release/goose${{ matrix.platform == 'win32-x64' && '.exe' || '' }}
key: ${{ steps.cache-key.outputs.key }}
- name: Build goose binary
- name: Build goose CLI binary
if: steps.binary-cache.outputs.cache-hit != 'true'
run: cargo build --release --target ${{ matrix.target }} --bin goose
@@ -227,7 +228,7 @@ jobs:
echo "Downloaded ACP schema:"
ls -lh crates/goose-acp/acp-*.json
echo ""
echo "Downloaded goose binaries:"
echo "Downloaded goose CLI binaries:"
ls -R goose-binaries/
- name: Install dependencies
@@ -259,7 +260,7 @@ jobs:
echo "### ACP Schema"
echo "✅ Generated and cached"
echo ""
echo "### Goose Binaries"
echo "### Goose CLI Binaries"
echo "✅ Built for all platforms:"
for dir in goose-binaries/goose-*; do
platform=$(basename "$dir" | sed 's/goose-//')
@@ -268,7 +269,7 @@ jobs:
echo ""
echo "### npm Packages"
echo "✅ @aaif/goose-acp"
echo "✅ @aaif/goose-text"
echo "✅ @aaif/goose (TUI)"
echo ""
} >> "$GITHUB_STEP_SUMMARY"
@@ -292,29 +293,52 @@ jobs:
echo "⚠️ Skipping actual npm publish (dry-run mode)"
echo ""
echo "To publish for real, run this workflow without dry-run enabled."
echo ""
echo "**Note:** Changesets will still run to verify functionality."
} >> "$GITHUB_STEP_SUMMARY"
fi
- name: Create Release Pull Request or Publish to npm
- name: Publish to npm
if: inputs.dry-run != true && github.ref == 'refs/heads/main'
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
with:
publish: pnpm run release
version: pnpm run version
commit: 'chore: version packages'
title: 'chore: version packages'
cwd: ui
run: |
cd ui
# Publish all packages in the workspace
pnpm publish -r --access public --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Publish summary
if: steps.changesets.outputs.published == 'true' && inputs.dry-run != true && github.ref == 'refs/heads/main'
- name: Dry run - Show what would be published
if: inputs.dry-run == true || github.ref != 'refs/heads/main'
run: |
cd ui
echo "## 📦 Packages that would be published:" | tee -a "$GITHUB_STEP_SUMMARY"
echo "" | tee -a "$GITHUB_STEP_SUMMARY"
# List all publishable packages
for pkg in acp text goose-binary/*/; do
if [ -f "$pkg/package.json" ]; then
name=$(jq -r '.name' "$pkg/package.json")
version=$(jq -r '.version' "$pkg/package.json")
echo "- $name@$version" | tee -a "$GITHUB_STEP_SUMMARY"
fi
done
echo "" | tee -a "$GITHUB_STEP_SUMMARY"
echo "**Note:** This is a dry run. No packages were published." | tee -a "$GITHUB_STEP_SUMMARY"
- name: Publish summary
if: inputs.dry-run != true && github.ref == 'refs/heads/main'
run: |
cd ui
{
echo "## 🚀 Published Packages"
echo ""
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | "- \(.name)@\(.version)"'
for pkg in acp text goose-binary/*/; do
if [ -f "$pkg/package.json" ]; then
name=$(jq -r '.name' "$pkg/package.json")
version=$(jq -r '.version' "$pkg/package.json")
echo "- $name@$version"
fi
done
} >> "$GITHUB_STEP_SUMMARY"