Repository navigation
ci: build and publish a release when a vX.Y.Z tag is pushed - #616
Conversation
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.
|
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
left a comment
There was a problem hiding this comment.
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.
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.
Part of #609 (stage 1: release on tag). Validation runs are tracked in #610. Supersedes #611.
What
Adds
.github/workflows/release.yml. Pushing avX.Y.Z[-PRERELEASE]tag publishes a release with no manual steps:ax-serverandax-task-runnerfor linux/amd64 and linux/arm64 and pushes them toghcr.io/google/ax/<image>:<tag>.axCLI, rendersdeploy/ax-server.yamlwith both images pinned by digest, and publishes the GitHub release with generated notes.Release assets:
ax_<os>_<arch>.tar.gzaxCLI for linux and darwin, amd64 and arm64.ax versionprints the tagchecksums.txtinstall.shreleases/latest/download/install.shmatches the archivesax-server.yamldeploy/ax-server.yamlwithax-serverand the default task image pinned by digest.AX_RUNNER_VOLUME_IMAGEis left empty: the runner volume (#619–#622) isn't released yet; tracked in #625postgres.yamldeploy/postgres.yamlThe notes start with install commands, the Substrate version from
go.mod, and the image digests.Safety
google/axpublishes. 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 withdry_runpush 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.:latestis moved only after refetching tags.mainor arelease-*branch.ARG TARGETARCH=amd64are refused. After the push, each platform image is checked for the right binary (x86-64 or aarch64).-rc.Ntags publish pre-releases.:latest(images and GitHub "Latest") moves only for the highest stable tag.Other changes
internal/version:Versionis stamped by the release build (ax versionprints it), along withImageRepoandImage().Image()is meant for theaxdeploydefaults (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
shellcheckandactionlintare clean.go vetandgo test ./cmd/ax ./internal/versionpass.install.sh(checksum verified,ax versionprintsv0.4.0-rc.1), rendered the manifests, and rancreate-release.shagainst a stubbedgh(new release, older patch without Latest, existing release that only gets missing assets).Review
A subagent review found three blockers, all fixed in the last commit:
After merge
Before the first publish: a
v*tag ruleset (Epic: Establish rulesets for branching, tagging, and merging #546) and ideally areleaseenvironment with required reviewers.The first publish should be a prerelease tag (
vX.Y.Z-rc.1). An org owner then makes theax-serverandax-task-runnerpackages public and links them togoogle/ax.Record runs in Validate the build and release workflow runs #610.