Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/build-native-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
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/**'
Comment thread
alexhancock marked this conversation as resolved.
- '.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-14
target: aarch64-apple-darwin
- platform: darwin-x64
os: macos-13
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: 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
Comment thread
jamadeo marked this conversation as resolved.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Package the stdio ACP binary instead of goose-acp-server

These native packages are consumed by ui/text/src/tui.tsx:1148-1160 as a stdin/stdout ACP transport via ndJsonStream, but this workflow now builds goose-acp-server, whose entry point in crates/goose-acp/src/bin/server.rs only starts an HTTP/WebSocket server. The stdio ACP entry point is still goose acp (crates/goose-cli/src/cli.rs:719-720,1700 -> crates/goose-acp/src/server.rs:1660-1666), so even if the acp-argument issue were fixed, every published native package from this job would still be the wrong executable for the TUI's auto-launch path.

Useful? React with 👍 / 👎.


- 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/
Comment on lines +81 to +82
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use a Windows-compatible shell for artifact preparation

GitHub’s Actions docs say run steps on windows-latest default to PowerShell unless you set shell: bash, so the bashisms here (mkdir -p and cp .../) will not execute on the win32-x64 matrix leg. That leg fails before uploading its artifact, which in turn breaks the combined native-binaries-all artifact that publish-npm.yml depends on.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds like it could be true?


- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: goose-acp-server-${{ matrix.platform }}
path: artifact/bin/
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
90 changes: 90 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Publish to npm

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write
id-token: write # Required for npm provenance

jobs:
build-native:
name: Build native binaries
uses: ./.github/workflows/build-native-packages.yml

release:
name: Release
runs-on: ubuntu-latest
needs: build-native
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Upgrade the publish runner before installing the full UI workspace

If this workflow is switched to the repo's actual workspace manager, the install will still fail under the Node version pinned here: the newly added desktop workspace requires node: ^24.10.0 and pnpm: >=10.30.0 in ui/desktop/package.json:6-8. I verified locally that pnpm install --frozen-lockfile --lockfile-only --ignore-scripts aborts on those engine checks under Node 22 / pnpm 10.13, so a Node 20 release runner cannot install the full ui/ workspace unless desktop is excluded or the runner is upgraded.

Useful? React with 👍 / 👎.

registry-url: 'https://registry.npmjs.org'

- name: Setup Rust
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable

- name: Setup Rust cache
uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2

- name: Download native binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ needs.build-native.outputs.artifact-name }}
path: native-binaries

- name: Copy binaries to package directories
run: |
for platform_dir in native-binaries/goose-acp-server-*; do
platform=$(basename "$platform_dir")
pkg_dir="ui/goose-acp-server/${platform}"

echo "Copying binaries for ${platform}..."
mkdir -p "${pkg_dir}/bin"
cp -v "${platform_dir}/bin/"* "${pkg_dir}/bin/"
chmod +x "${pkg_dir}/bin/"*
done

- name: Install dependencies
run: |
cd ui
npm ci
Comment on lines +58 to +61
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use a package manager that can install the new UI workspace

This release job now installs ui/ with npm, but the workspace committed here is pnpm-only. I checked cd ui && npm ci --ignore-scripts --dry-run, and npm aborts immediately because this commit deleted ui/package-lock.json; switching to npm install does not help, because npm then exits with EUNSUPPORTEDPROTOCOL on the new workspace:* dependencies (for example ui/text/package.json:34 and ui/desktop/package.json:72). In other words, the job cannot get past dependency installation, so it never reaches the build or publish steps.

Useful? React with 👍 / 👎.


- name: Build packages
run: |
cd ui/acp
npm run build

cd ../text
npm run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@6d3568c53fbe1db6c1f9ab1c7fbf9092bc18627f # v1
with:
publish: npm run release
version: npm run version
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Regenerate the pnpm lockfile in release PRs

When this job runs in the “open/update release PR” path, changesets/action only executes npm run version here, so the PR will contain version-bumped ui/**/package.json files but no refreshed ui/pnpm-lock.yaml. I checked .github/workflows/ci.yml:123 and .github/workflows/bundle-desktop.yml:149 (same pattern in the other desktop bundle workflows), and they still run pnpm install --frozen-lockfile from ui/desktop; those jobs will fail as soon as the release PR changes any package version or internal workspace range because the checked-in lockfile is now out of sync.

Useful? React with 👍 / 👎.

commit: 'chore: version packages'
title: 'chore: version packages'
cwd: ui
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Summary
if: steps.changesets.outputs.published == 'true'
run: |
echo "## Published Packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | "- \(.name)@\(.version)"' >> $GITHUB_STEP_SUMMARY
Comment thread Dismissed
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion npm/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions npm/README.md

This file was deleted.

8 changes: 8 additions & 0 deletions ui/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions ui/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude the desktop app from the Changesets release set

Changesets' CLI docs say publish walks each package and runs npm publish for versions not already on npm, and their app-versioning guide says non-npm apps should be private. With ignore left empty here, ui/package.json now brings desktop into the workspace, but ui/desktop/package.json is still a public package named goose-app. Any release where that local version is ahead of the registry will therefore try to publish the Electron app alongside @aaif/goose, which is outside the intended release set and can fail the npm release job.

Useful? React with 👍 / 👎.

}
11 changes: 11 additions & 0 deletions ui/.changeset/initial-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@aaif/goose-acp": minor
"@aaif/goose": minor
"@aaif/goose-acp-server-darwin-arm64": minor
"@aaif/goose-acp-server-darwin-x64": minor
"@aaif/goose-acp-server-linux-arm64": minor
"@aaif/goose-acp-server-linux-x64": minor
"@aaif/goose-acp-server-win32-x64": minor
Comment on lines +2 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid skipping the intended 0.1.0 npm release

Checked ui/.changeset/initial-release.md against the new workspace manifests: every package already starts at 0.1.0, so marking the "initial release" as minor will make the first changeset version run bump them straight to 0.2.0. If the goal is to publish these packages initially at 0.1.0, this changeset needs a smaller bump (or the manifests need to start from a lower version).

Useful? React with 👍 / 👎.

---

Initial release of Goose npm packages
4 changes: 4 additions & 0 deletions ui/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
registry=https://registry.npmjs.org/
prefer-offline=true
node-linker=hoisted
supportedArchitectures.os=current,linux,darwin,win32
supportedArchitectures.cpu=current,x64,arm64
Loading
Loading