From b649e7d1f26045713f3062e893c6939735cde39a Mon Sep 17 00:00:00 2001 From: Jonathan Mohrbacher Date: Fri, 20 Nov 2026 11:08:13 -0500 Subject: [PATCH 1/2] [NO-JIRA] Publish the aarch64-apple-darwin CLI with each patched release patched-release.yml now also builds the CLI with upstream's bundle-macos.yml (aarch64-apple-darwin, CLI only, unsigned) and the release requires it, so the Mac can run the same patched goose as the Linux hosts from a Nix fetch. patched-release-darwin.yml backfills darwin assets onto a release published before this change: push darwin-backfill-; it builds from , uploads the darwin tarballs and regenerates SHA256SUMS. Linux assets are untouched. Part of workstation-6w7i.17. --- .github/workflows/patched-release-darwin.yml | 71 ++++++++++++++++++++ .github/workflows/patched-release.yml | 31 +++++++-- 2 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/patched-release-darwin.yml diff --git a/.github/workflows/patched-release-darwin.yml b/.github/workflows/patched-release-darwin.yml new file mode 100644 index 000000000000..d7cc694f3b3e --- /dev/null +++ b/.github/workflows/patched-release-darwin.yml @@ -0,0 +1,71 @@ +# Adds the aarch64-apple-darwin CLI to an EXISTING patched-* release that was published +# before patched-release.yml built darwin. The binary is built from the release's own tag, +# so it is the same source as the Linux assets already on that release; the Linux assets +# are left untouched and SHA256SUMS is regenerated over every asset. +# +# Run: push a tag named darwin-backfill-, e.g. darwin-backfill-patched-1.54.0.15, +# at any commit that has this file (the build checks out the release tag, not the pushed one). +# A tag push rather than workflow_dispatch: dispatch needs the file on the default branch, +# which here is an upstream mirror. +on: + push: + tags: + - "darwin-backfill-patched-*" + +name: "Patched release (darwin backfill)" + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.resolve.outputs.tag }} + sha: ${{ steps.resolve.outputs.sha }} + steps: + - id: resolve + env: + GH_TOKEN: ${{ github.token }} + PUSHED: ${{ github.ref_name }} + run: | + TAG="${PUSHED#darwin-backfill-}" + case "$TAG" in patched-*) ;; *) echo "not a patched-* tag: $TAG" >&2; exit 1 ;; esac + gh release view "$TAG" --repo "$GITHUB_REPOSITORY" > /dev/null + sha="$(gh api "repos/$GITHUB_REPOSITORY/commits/$TAG" --jq .sha)" + echo "tag=$TAG" >> "$GITHUB_OUTPUT" + echo "sha=$sha" >> "$GITHUB_OUTPUT" + + build-macos: + needs: check + uses: ./.github/workflows/bundle-macos.yml + permissions: + contents: read + with: + target: aarch64-apple-darwin + package_cli: true + package_desktop: false + signing: false + ref: ${{ needs.check.outputs.sha }} + + upload: + needs: [check, build-macos] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + name: goose-aarch64-apple-darwin + path: dist + - name: Upload to the release + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ needs.check.outputs.tag }} + run: | + test -f dist/goose-aarch64-apple-darwin.tar.gz + mkdir all + gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --dir all --pattern 'goose-*' + cp dist/* all/ + (cd all && sha256sum goose-* > SHA256SUMS && cat SHA256SUMS) + gh release upload "$TAG" dist/* all/SHA256SUMS --repo "$GITHUB_REPOSITORY" --clobber diff --git a/.github/workflows/patched-release.yml b/.github/workflows/patched-release.yml index f71f2a15bac6..327535407a40 100644 --- a/.github/workflows/patched-release.yml +++ b/.github/workflows/patched-release.yml @@ -1,7 +1,11 @@ -# Modified by Jonathan Mohrbacher, 2026: test-patches runs subdirectory hints tests; test-patches runs message id / truncate_from_message tests. +# Modified by Jonathan Mohrbacher, 2026: test-patches runs subdirectory hints tests; test-patches runs message id / truncate_from_message tests; the release also carries the aarch64-apple-darwin CLI. # Builds this branch (an upstream release tag plus a few local patches) with upstream's own -# Linux CLI build workflow, so the result differs from the upstream release only by the patches, -# and publishes the gnu tarballs as a release of this fork. +# Linux CLI build workflow and upstream's macOS bundle workflow (CLI only, unsigned), so the result +# differs from the upstream release only by the patches, and publishes the gnu tarballs and the +# aarch64-apple-darwin tarballs as a release of this fork. +# +# A release made before the darwin build was added gets its darwin assets from +# patched-release-darwin.yml (workflow_dispatch with the tag). # # Run: push a tag named patched-., e.g. patched-1.54.0.1, on the patched branch. # The name must not start with "v": upstream's release.yml and publish-docker.yml fire on v* tags. @@ -23,6 +27,20 @@ jobs: with: ref: ${{ github.sha }} + # The Mac runs the same patched goose as the Linux hosts (workstation pkgs/goose). + # Unsigned: the Nix fetch never sets a quarantine attribute, and the linker's ad-hoc + # signature is all Apple Silicon needs to exec a binary. + build-macos: + uses: ./.github/workflows/bundle-macos.yml + permissions: + contents: read + with: + target: aarch64-apple-darwin + package_cli: true + package_desktop: false + signing: false + ref: ${{ github.sha }} + # Unit tests for the patched code paths (including the vendored acp-http crate), on the same toolchain. test-patches: runs-on: ubuntu-24.04-arm @@ -51,7 +69,7 @@ jobs: cargo test --release -p agent-client-protocol-http --features server --lib release: - needs: [build, test-patches] + needs: [build, build-macos, test-patches] if: ${{ !cancelled() && needs.test-patches.result == 'success' }} runs-on: ubuntu-latest permissions: @@ -62,6 +80,10 @@ jobs: pattern: goose-*-unknown-linux-gnu merge-multiple: true path: dist + - uses: actions/download-artifact@v4 + with: + name: goose-aarch64-apple-darwin + path: dist - name: Create release env: GH_TOKEN: ${{ github.token }} @@ -69,6 +91,7 @@ jobs: run: | ls -la dist test -f dist/goose-aarch64-unknown-linux-gnu.tar.gz + test -f dist/goose-aarch64-apple-darwin.tar.gz (cd dist && sha256sum * > SHA256SUMS) gh release create "$TAG" dist/* --repo "$GITHUB_REPOSITORY" --target "$GITHUB_SHA" \ --title "$TAG" --notes "Upstream goose v$(echo "$TAG" | sed -E 's/^patched-([0-9]+[.][0-9]+[.][0-9]+).*/\1/') plus the local patches committed after that tag at $GITHUB_SHA." From 826963702f8af05a618c58519b6b92f52e1f4e4c Mon Sep 17 00:00:00 2001 From: Jonathan Mohrbacher Date: Fri, 20 Nov 2026 11:12:03 -0500 Subject: [PATCH 2/2] [NO-JIRA] Backfill refuses to replace darwin assets; fix run instruction --- .github/workflows/patched-release-darwin.yml | 14 ++++++++++++-- .github/workflows/patched-release.yml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/patched-release-darwin.yml b/.github/workflows/patched-release-darwin.yml index d7cc694f3b3e..7f2bfcb9f240 100644 --- a/.github/workflows/patched-release-darwin.yml +++ b/.github/workflows/patched-release-darwin.yml @@ -1,7 +1,8 @@ # Adds the aarch64-apple-darwin CLI to an EXISTING patched-* release that was published # before patched-release.yml built darwin. The binary is built from the release's own tag, # so it is the same source as the Linux assets already on that release; the Linux assets -# are left untouched and SHA256SUMS is regenerated over every asset. +# are left untouched and SHA256SUMS is regenerated over every asset. It refuses a release +# that already has darwin assets. # # Run: push a tag named darwin-backfill-, e.g. darwin-backfill-patched-1.54.0.15, # at any commit that has this file (the build checks out the release tag, not the pushed one). @@ -33,6 +34,14 @@ jobs: case "$TAG" in patched-*) ;; *) echo "not a patched-* tag: $TAG" >&2; exit 1 ;; esac gh release view "$TAG" --repo "$GITHUB_REPOSITORY" > /dev/null sha="$(gh api "repos/$GITHUB_REPOSITORY/commits/$TAG" --jq .sha)" + test -n "$sha" + # A Rust build is not reproducible: replacing a darwin asset would break every + # pinned hash of it. Refuse rather than clobber; delete the asset by hand to redo. + if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json assets --jq '.assets[].name' \ + | grep -qx 'goose-aarch64-apple-darwin.tar.gz'; then + echo "$TAG already has darwin assets; refusing to replace them" >&2 + exit 1 + fi echo "tag=$TAG" >> "$GITHUB_OUTPUT" echo "sha=$sha" >> "$GITHUB_OUTPUT" @@ -68,4 +77,5 @@ jobs: gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --dir all --pattern 'goose-*' cp dist/* all/ (cd all && sha256sum goose-* > SHA256SUMS && cat SHA256SUMS) - gh release upload "$TAG" dist/* all/SHA256SUMS --repo "$GITHUB_REPOSITORY" --clobber + gh release upload "$TAG" dist/* --repo "$GITHUB_REPOSITORY" + gh release upload "$TAG" all/SHA256SUMS --repo "$GITHUB_REPOSITORY" --clobber diff --git a/.github/workflows/patched-release.yml b/.github/workflows/patched-release.yml index 327535407a40..fa35df16ea3a 100644 --- a/.github/workflows/patched-release.yml +++ b/.github/workflows/patched-release.yml @@ -5,7 +5,7 @@ # aarch64-apple-darwin tarballs as a release of this fork. # # A release made before the darwin build was added gets its darwin assets from -# patched-release-darwin.yml (workflow_dispatch with the tag). +# patched-release-darwin.yml (push a darwin-backfill- tag). # # Run: push a tag named patched-., e.g. patched-1.54.0.1, on the patched branch. # The name must not start with "v": upstream's release.yml and publish-docker.yml fire on v* tags.