Skip to content

ci: build and publish a release when a vX.Y.Z tag is pushed - #616

Merged
MushuEE merged 8 commits into
mainfrom
ci/release-on-tag
Nov 17, 2026
Merged

MushuEE merged 8 commits into
mainfrom
ci/release-on-tag

Conversation

@MushuEE

@MushuEE MushuEE commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #609 (stage 1: release on tag). Validation runs are tracked in #610. Supersedes #611.

What

Adds .github/workflows/release.yml. Pushing a vX.Y.Z[-PRERELEASE] tag publishes a release with no manual steps:

  1. images: builds ax-server and ax-task-runner for linux/amd64 and linux/arm64 and pushes them to ghcr.io/google/ax/<image>:<tag>.
  2. release: builds the ax CLI, renders deploy/ax-server.yaml with both images pinned by digest, and publishes the GitHub release with generated notes.

Release assets:

Asset Contents
ax_<os>_<arch>.tar.gz ax CLI for linux and darwin, amd64 and arm64. ax version prints the tag
checksums.txt SHA-256 of each archive
install.sh The installer from #603, so releases/latest/download/install.sh matches the archives
ax-server.yaml deploy/ax-server.yaml with ax-server and the default task image pinned by digest. AX_RUNNER_VOLUME_IMAGE is left empty: the runner volume (#619–#622) isn't released yet; tracked in #625
postgres.yaml deploy/postgres.yaml

The notes start with install commands, the Substrate version from go.mod, and the image digests.

Safety

  • Gated publishing: only google/ax publishes. Pull requests that touch the release (the workflow, hack/release/**, Dockerfile.*, .dockerignore, deploy/**, install.sh, go.mod/go.sum, cmd/ax*/**, internal/version/**) and manual runs with dry_run push images to a registry inside the job and create no release. The dry run also reruns the image step to check that it reuses the same digests.
  • Stable digests: an image that already exists for the tag on both platforms is never rebuilt, and only missing images are built. Once the release is published, nothing is built at all. A registry error (auth, rate limit, network) fails the run instead of rebuilding. ghcr.io's DENIED for a never-pushed package is resolved through the packages API. Concurrency is keyed by tag, and :latest is moved only after refetching tags.
  • Reviewed commits only: the tag must be on main or a release-* branch.
  • Real multi-arch: Dockerfiles that pin ARG TARGETARCH=amd64 are refused. After the push, each platform image is checked for the right binary (x86-64 or aarch64).
  • Prereleases: -rc.N tags publish pre-releases. :latest (images and GitHub "Latest") moves only for the highest stable tag.
  • Existing releases: a published release only gets the assets it lacks; notes and attached assets are never replaced. A leftover draft gets this run's assets and notes and is published. Manual runs work only for tags that contain this workflow.

Other changes

  • internal/version: Version is stamped by the release build (ax version prints it), along with ImageRepo and Image(). Image() is meant for the axdeploy defaults (TODO(release) from feat(cli): add ax local, ax install/uninstall, and one-line installer #603) once a release is published.
  • hack/release/*.sh: each workflow step is a script that also runs locally.
  • docs/releasing.md: release process, assets, reruns, and dry runs.

Agent task images are out of scope. They are built and released in agentexecutor/images.

Testing

  • shellcheck and actionlint are clean. go vet and go test ./cmd/ax ./internal/version pass.
  • Locally: built the CLI archives, installed them with feat(cli): add ax local, ax install/uninstall, and one-line installer #603's install.sh (checksum verified, ax version prints v0.4.0-rc.1), rendered the manifests, and ran create-release.sh against a stubbed gh (new release, older patch without Latest, existing release that only gets missing assets).
  • The image build has not run yet. This PR's own dry run is the first end-to-end check of it.

Review

A subagent review found three blockers, all fixed in the last commit:

  1. GHCR answers DENIED for a never-pushed package, so the first publish would have failed.
  2. A failed second registry call could have triggered a rebuild over a published tag.
  3. An incomplete set rebuilt images that were already complete.

After merge

Pushing a release tag now builds ax-server and ax-task-runner for
linux/amd64 and linux/arm64 and pushes them to ghcr.io/google/ax, then
publishes the GitHub release with the ax CLI (linux/darwin, amd64/arm64,
with sha256 files), ax-server.yaml rendered with both images pinned by
digest, and postgres.yaml. Pre-release tags publish pre-releases.

Pull requests that touch the release run it as a dry run against a
registry inside the job. ax version now prints the release version.
…e archives

Add internal/version (Version, ImageRepo, Image) so code that deploys AX,
such as ax install in #603, can default to the images of its own release,
or :latest for dev builds. The highest stable release now moves :latest.

Ship the CLI as ax_<os>_<arch>.tar.gz with checksums.txt, and attach
install.sh when the tag has one, matching what install.sh downloads.
Key concurrency by tag, dry-run on any Dockerfile.* change, fail the
existence check on registry errors instead of rebuilding, refuse
Dockerfiles that pin TARGETARCH, verify each platform image holds the
right binary, and write digests to the job summary. Export task_image
for stage 2 agent images and point the docs at #609 and #610.
@mayawang

Copy link
Copy Markdown
Collaborator

Looks great, nice that the release is fully hands-off. One ordering thing: there's no tag ruleset live yet (#574 is still inside #573's branch and nothing's been applied), so once this merges anyone with maintain could push a vX.Y.Z tag and publish to ghcr.io/google/ax. Could we land the tag protection (plus the admin bypass) first? I'll apply the rulesets right after, then this can go in.

- Never rebuild over a published tag on a registry error: the second
  inspect call fails closed, stderr is kept out of the manifest, and
  ghcr.io's DENIED for a never-pushed package is resolved through the
  packages API instead of failing the first release.
- Rebuild only missing or incomplete images, and nothing at all once the
  release is published; read the release state fail-closed.
- Refuse tags that are not on main or a release-* branch.
- Publish a leftover draft with this run's assets and notes instead of
  leaving it stale; upload only known assets.
- Refetch tags before moving :latest so an older release cannot take it
  back.
- Dry runs cover go.mod, install.sh, cmd and internal/version changes,
  and rerun the image step to check that it reuses the same digests.
- Reproducible CLI archives (fixed mtime, gzip -n); index annotations so
  GHCR links multi-arch packages; docs for older tags and prerequisites.

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks for the dry run. Tag protection is now live (protect-tags, active: only admins can create/move/delete tags, names must match vX.Y.Z), so this is safe to merge. Non-blocking: please land protect-tags.json on main with enforcement: active so the ruleset drift check matches. Ping me or @rakyll when you want an rc tag cut.

MushuEE and others added 3 commits November 17, 2026 02:55
main added Dockerfile.runner-volume (#619) and an AX_RUNNER_VOLUME_IMAGE
placeholder to deploy/ax-server.yaml (#620), which failed the render
step's leftover-placeholder check.

Releases now also publish ghcr.io/google/ax/ax-runner-volume (multi-arch,
binary checked per platform) and list its digest in the notes. The
rendered manifest leaves AX_RUNNER_VOLUME_IMAGE empty, the same default
as the Makefile, so tasks keep running the runner baked into their image
until an operator opts in.
The runner volume work (#619, #620) is not ready, so releases no longer
build or publish ax-runner-volume. The rendered ax-server.yaml still
fills the AX_RUNNER_VOLUME_IMAGE placeholder with an empty value, so
tasks run the runner baked into their image and the render step's
leftover-placeholder check passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants