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
73 changes: 58 additions & 15 deletions .github/workflows/release-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,49 @@ jobs:
fi
echo "Building version ${VERSION}"
mkdir -p dist
for bin in abctl authbridge-proxy; do
for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do
os="${target%/*}"
arch="${target#*/}"
echo "==> ${bin} ${os}/${arch}"
( cd "authbridge/cmd/${bin}" && \
GOWORK=off CGO_ENABLED=0 GOOS="${os}" GOARCH="${arch}" \
go build -trimpath \
-ldflags "-s -w -X main.version=${VERSION}" \
-o "${GITHUB_WORKSPACE}/dist/${bin}" . )
tar -C dist -czf "dist/${bin}_${VERSION}_${os}_${arch}.tar.gz" "${bin}"
rm -f "dist/${bin}"

# authbridge-proxy variants: "<suffix>:<build-tags>". Empty
# suffix is the default plugin set. One variant per opt-in
# plugin (or one combined "full") — never enumerate combos.
lite_tags="exclude_plugin_a2aparser,exclude_plugin_ibac"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: this lite_tags list is a hand-maintained duplicate of the 7-tag exclude_plugin_* set in build.yaml's authbridge-lite image build. The two copies can silently drift — e.g. if an 8th exclude tag is added to the image build (there's an in-flight PR doing exactly that for toolprune), this list would be left behind and the -lite binary would then include a plugin the -lite image excludes. Consider sourcing both from one place (a shared tags file both workflows read, or a composite action) so parity can't rot. Non-blocking — a follow-up is fine.

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.

suggestion — this is now the fourth code copy of the lite tag list, after ci.yaml:110-111, build.yaml:59, and local-build-and-test.sh (plus prose in both CLAUDE.mds). I diffed the three existing ones and they agree exactly today, so -lite does match the image and nothing is broken right now.

The timing is what makes it worth raising: #761 adds exclude_plugin_lineage, and #852's PR body budgets for "one token in each of those three lists" — already an undercount before this PR, and now off by one more. Because a missing exclude tag fails open (the plugin silently compiles in, the binary just gets bigger), a copy that drifts produces a -lite tarball that quietly no longer matches authbridge-lite, with no build error.

A single definition the three workflows and the script all read — a lite-tags file, or a repo-level env — would make the next plugin a one-line change. Reasonable to defer, but the next person to add a plugin is the one who pays.

lite_tags="${lite_tags},exclude_plugin_inferenceparser"
lite_tags="${lite_tags},exclude_plugin_mcpparser,exclude_plugin_opa"
lite_tags="${lite_tags},exclude_plugin_sparc,exclude_plugin_tokenbroker"
declare -a proxy_variants=(
":"
"lite:${lite_tags}"
"sessionbudget:include_plugin_sessionbudget"
)

build_proxy() {
local variant="$1" tags="$2" os="$3" arch="$4"
local suffix=""; [ -n "${variant}" ] && suffix="-${variant}"
local archive="dist/authbridge-proxy${suffix}_${VERSION}_${os}_${arch}.tar.gz"
echo "==> authbridge-proxy${suffix} ${os}/${arch}"
( cd authbridge/cmd/authbridge-proxy && \
GOWORK=off CGO_ENABLED=0 GOOS="${os}" GOARCH="${arch}" \
go build -trimpath \
-tags "${tags}" \
-ldflags "-s -w -X main.version=${VERSION}" \
-o "${GITHUB_WORKSPACE}/dist/authbridge-proxy" . )
tar -C dist -czf "${archive}" authbridge-proxy
rm -f dist/authbridge-proxy
}

for target in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do
os="${target%/*}"; arch="${target#*/}"

echo "==> abctl ${os}/${arch}"
( cd authbridge/cmd/abctl && \
GOWORK=off CGO_ENABLED=0 GOOS="${os}" GOARCH="${arch}" \
go build -trimpath \
-ldflags "-s -w -X main.version=${VERSION}" \
-o "${GITHUB_WORKSPACE}/dist/abctl" . )
tar -C dist -czf "dist/abctl_${VERSION}_${os}_${arch}.tar.gz" abctl
rm -f dist/abctl

for entry in "${proxy_variants[@]}"; do
build_proxy "${entry%%:*}" "${entry#*:}" "${os}" "${arch}"
done
done
( cd dist && sha256sum ./*.tar.gz > checksums.txt )
Expand All @@ -72,9 +103,21 @@ jobs:
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
notes="Prebuilt \`abctl\` and \`authbridge-proxy\` binaries for linux and macOS (amd64/arm64).

Verify downloads with \`sha256sum -c checksums.txt\`. On macOS, clear the Gatekeeper quarantine after extracting: \`xattr -dr com.apple.quarantine ./abctl\`."
# Build release notes one line at a time so no single string
# exceeds yamllint's 150-char cap. Single-quoted arguments keep
# backticks literal (no shell expansion).
notes=""
add() { notes="${notes}${1}"$'\n'; }
add 'Prebuilt `abctl` and `authbridge-proxy` binaries for linux and macOS (amd64/arm64).'
add ''
add '`authbridge-proxy` ships in variants matching the container images:'
add 'unqualified (default plugin set, matches the `authbridge` image),'
add '`-lite` (auth-only, matches `authbridge-lite`), plus one variant per'
add 'opt-in plugin currently offered for try-out (today: `-sessionbudget`).'
add 'Variants track opt-in plugins one-for-one; arbitrary combinations are not published.'
add ''
add 'Verify downloads with `sha256sum -c checksums.txt`. On macOS, clear the'
add 'Gatekeeper quarantine after extracting: `xattr -dr com.apple.quarantine ./abctl`.'
if gh release view "${TAG}" >/dev/null 2>&1; then
gh release upload "${TAG}" dist/*.tar.gz dist/checksums.txt --clobber
else
Expand Down
18 changes: 18 additions & 0 deletions authbridge/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ binaries with shared auth logic in `authlib/`:
Each binary is hardcoded to its deployment shape; mode is no longer selected
at runtime. The YAML `mode:` field must match the binary or boot fails.

### Release binaries

`v*` tag pushes trigger `.github/workflows/release-binaries.yaml`, which
cross-compiles `authbridge-proxy` and `abctl` for linux/darwin ×
amd64/arm64 and attaches tarballs to the GitHub Release. `authbridge-proxy`
ships in variants that mirror the container images:

| Variant | Tarball name shape | Matches |
|---|---|---|
| unqualified (default plugins) | `authbridge-proxy_<ver>_<os>_<arch>.tar.gz` | `authbridge` image |
| `-lite` (drops the OPA SDK and the protocol parsers) | `authbridge-proxy-lite_<ver>_<os>_<arch>.tar.gz` | `authbridge-lite` image |
| `-sessionbudget` (default + opt-in session-budget) | `authbridge-proxy-sessionbudget_<ver>_<os>_<arch>.tar.gz` | no image today |

One variant per opt-in plugin currently offered for try-out (today:
`-sessionbudget`) — never enumerate combos. To add one, append to the
`proxy_variants` array in the workflow. `authbridge-cpex` stays image-only
(needs cgo); `context-guru` is opt-in but not yet offered as a variant.

See [`authlib/README.md`](authlib/README.md) for the library reference.

## What AuthBridge Does
Expand Down
Loading