Releases are cut from main by pushing an annotated tag. The
release workflow does the rest. Only the
repository owner can create or move release tags, and, like every workflow, the
release waits for the owner's approval before it starts.
| What | Rule | Example |
|---|---|---|
| Release tag | vMAJOR.MINOR.PATCH, annotated, created from main |
v0.1.0 |
| Pre-release | -alpha.N, -beta.N or -rc.N, marked as a pre-release |
v0.1.0-rc.1 |
| One version | Both images, the Helm chart (version and appVersion, without the v) and install.yaml carry the same version |
chart 0.1.0, images v0.1.0 |
While the API is v1alpha1, a minor bump may break and a patch is fixes only.
Never delete or move a published tag. If a release is wrong, publish a fixed
patch and say so in the notes of the bad release.
- Every issue in the milestone is closed or moved, and
mainis green. - Open the draft release notes (see release.yml for how pull requests are sorted). Each breaking change says what to do instead.
- Set the version that the quickstart installs, the
--versionof itshelm install, to the version you are about to tag, without thev, in a pull request, and merge it.hack/quickstart-version.shprints the version of the page. The release fails at its first step when the two differ, except that a pre-release may leave the page at a release that is not a pre-release. - Create an annotated tag on
main, at that merge or after it, and push it:git tag -a v0.1.0 -m "v0.1.0" git push origin v0.1.0 - Approve the Release run on the Actions tab (Review pending
deployments, then
ci), and watch it finish. - Verify the signatures (below).
- Run the quickstart and the worked examples against what was published:
make test-quickstart RELEASED=1makes a kind cluster, runs every command of the pages as they are written, with the published chart and images, and deletes the cluster. Then, on a clean kind cluster, install once frominstall.yaml, which the quickstart does not use, and check that the operator rolls out and names the agent image of the release:kubectl apply -f https://github.com/mohanedmoh/treebind/releases/download/v0.1.0/install.yaml kubectl -n treebind-system rollout status deployment/treebind-controller-manager kubectl -n treebind-system get deployment treebind-controller-manager \ -o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="AGENT_IMAGE")].value}' - Announce in Discussions with the release link and any upgrade notes.
- Checks that the tag is
vplus a semantic version, that its commit is onmain, and that the quickstart installs this version (step 3 of the checklist). - Runs lint, the tests and the end-to-end suite again on the tagged commit.
- Checks Chainguard's signature on the agent's base image, then builds the
operator and agent images with ko for
linux/amd64andlinux/arm64, and pushes them toghcr.io/mohanedmoh/treebind-operatorandghcr.io/mohanedmoh/treebind-agent, tagged with the version and referred to by digest. ko attaches an SPDX SBOM to each image. - Signs every image digest with cosign, keyless, using the workflow's identity.
- Packages the chart with the release version, pushes it to
oci://ghcr.io/mohanedmoh/charts, and signs it. For a pre-release it adds the annotationartifacthub.io/prerelease: "true"to the chart first, and the step fails when the packaged chart has the annotation on a release that is not one or lacks it on one that is. - Renders
install.yamlfromconfig/defaultwith the digests of the operator image and of the agent image filled in (hack/build-installer.sh). The base names an agent image that no release publishes, so the script reads the result back and fails the release wheninstall.yamldoes not say the two digests or has an image with the taglatest. CI runs the same script with digests that are not published. - Creates a draft GitHub release with notes generated from pull request
labels, attaches
install.yaml, the SBOMs andchecksums.txt, and only then publishes it. A release that is already published cannot change once immutable releases are on, which is why the order matters. A tag with a suffix such as-rc.1is marked as a pre-release. - Pushes
charts/artifacthub-repo.ymlto the OCI repository of the chart at the tagartifacthub.io, for Artifact Hub.
Images and the chart are signed by the release workflow's identity. Replace the digest with the one from the release page:
cosign verify \
--certificate-identity-regexp '^https://github.com/mohanedmoh/treebind/\.github/workflows/release\.yml@refs/tags/v.+$' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
ghcr.io/mohanedmoh/treebind-operator@sha256:<digest>The same command works for treebind-agent and for
ghcr.io/mohanedmoh/charts/treebind@sha256:<digest>. Check the downloaded
assets against checksums.txt:
sha256sum --check --ignore-missing checksums.txtPin images by digest in production. The tag is a convenience and can be re-pointed by whoever can push to the registry; the digest cannot.
The agent runs Git and ssh, so unlike the operator it is not built on distroless.
.ko.yaml gives it Chainguard's cgr.dev/chainguard/git as its base, pinned by
the digest of its multi-platform index. The image runs as UID 65532 with a passwd
entry and carries Git, OpenSSH and the CA certificates. For every package in it
there is an SPDX SBOM under /var/lib/db/sbom, with the license and the source
of the package. Git is GPL-2.0-only. The reasons for this base, and what they
cost, are in ADR 0010.
Two scripts keep it honest. CI runs both on every pull request, and the release runs the first before it publishes:
hack/verify-agent-base.shchecks that Chainguard signed the digest in.ko.yaml. It needs cosign.hack/check-agent-image.sh <image>runs the agent image with the settings of the sync pod, a read-only root filesystem, no capabilities and no privilege escalation. It checks that the user is numeric and not root, that Git is not older thanMIN_GIT, that ssh finds the user in the passwd file, and that Git can make a commit.make check-agent-imagebuilds the image and runs it.
The agent carries the Git of its base image, so a Git fix reaches users in a new release of the agent:
- Look up the digest of the current image. Chainguard rebuilds the image as its
packages are updated. The
Digest:line of the index is the one to pin:docker buildx imagetools inspect cgr.dev/chainguard/git:latest
- Put it in
.ko.yaml, underbaseImageOverrides. - Raise
MIN_GITinhack/check-agent-image.shto the release that has the fix, so that a base with an older Git fails. - Run
hack/verify-agent-base.shandmake check-agent-image, and open the pull request. - After it merges, cut a patch release. A published image never changes.
The workflow publishes three GHCR packages: treebind-operator,
treebind-agent and charts/treebind. A package that a workflow creates is
linked to this repository and takes its visibility, so while the repository is
public the packages are public too. After the first release, check each one
under your profile's Packages. If one is private, open it, then Package
settings, then Change visibility, then Public; GHCR has no API for
that setting.
Right after GHCR creates a new package it can briefly refuse the next write, so the workflow retries registry writes (the image builds, the chart push and the signatures) with a growing delay.
The chart carries what Artifact Hub shows of it: the artifacthub.io/* annotations of
charts/treebind/Chart.yaml (license, category, the CRD, links) and the chart's README.md. The annotation
artifacthub.io/prerelease: "true", which makes Artifact Hub list a version as a pre-release, is not in the file: the release
workflow adds it to the chart of a tag with a suffix, as it sets the version. The repository
oci://ghcr.io/mohanedmoh/charts/treebind is registered in the Artifact Hub account of the owner, as a repository of kind Helm
charts, and Artifact Hub reads each new version of the chart by itself.
What makes the listing a verified publisher is charts/artifacthub-repo.yml, which holds the ID that Artifact Hub gave the
repository. It is pushed to the same OCI repository at the tag artifacthub.io, with the media types that Artifact Hub looks for,
by hack/push-artifacthub-repo.sh. The release workflow runs that as its last step, after the release is published, so a failure
of it is a red run and not a release that is half made. It is the same file every time, so a push that is repeated changes
nothing. To push it by hand, as for a repository that has had no release since the file was added, log in to the registry with a
token that may write the package (write:packages) and run the script with oras:
echo "$TOKEN" | oras login ghcr.io --username <owner> --password-stdin
hack/push-artifacthub-repo.sh ghcr.io/<owner>/charts/treebindThe file has no owners, because Artifact Hub takes the email of an owner from the account and makes it public in the artifact.
Artifact Hub scans the images that artifacthub.io/images lists, and the chart does not list any, because their tag is the version
of a release.
The release workflow downloads ko, cosign and Helm at pinned versions and checks
each download against a pinned SHA-256. To update one, change its version and
checksum together in release.yml, and run the release against a throwaway
pre-release tag first.