Skip to content

Releasing

How a version gets from main to users. The rules behind it (patch vs minor, upgrade compatibility, branches) are in ADR-0027; publishing is automated by .github/workflows/release.yml (ADR-0025).

<v> below is the new version without the v (0.2.0), <prev> the last release.

  • Patch or minor? A patch is fixes only. A minor brings something new that is ready and on by default.
  • Is main releasable? Unfinished work must be switched off by default. If main already holds changes that should not ship in a patch, release the patch from a branch instead (see A patch from a release branch).
  • Pinned components. Look at the releases and security advisories of everything that is pinned: BuildKit (the daemons’ default in charts/buildkit, the CI component’s client image in ci/gitlab/build.yml and the image build in scripts/build-image.sh use the same release), cert-manager, k3s and Helm in scripts/quickstart.sh, the gitlab-runner chart and image (also in integrations/gitlab-runner/values.yaml), Go and the image’s base images (cmd/ci-accelerator/Dockerfile), Node, the kind node image, the e2e images (test/e2e/run.sh), the tools in the Makefile, and the actions and the Helm versions in the workflows. Bump what has a fix and is at least two weeks old - except a security patch (see below).
  • Security patches skip the two-weeks wait (ADR-0041): a patch release of the same minor line that fixes a vulnerability which affects the project (govulncheck, trivy, Dependabot or the advisory says so) may be pinned at once, provided the full CI passes; the changelog names the exception. A new minor waits the two weeks even when it carries security fixes.

On a branch release/v<v>:

  1. Set the version everywhere it is named (scripts/check-release-version.sh in step 3 checks all but the README’s status line and the content of artifacthub.io/changes):

    • version: in charts/buildkit/Chart.yaml;
    • version: and appVersion: in charts/control-plane/Chart.yaml (the appVersion is the ci-accelerator image’s tag, v<appVersion>);
    • version: and appVersion: in charts/ci-accelerator/Chart.yaml (the box’s version is its own, not BuildKit’s);
    • the buildkit and control-plane dependencies’ version: in charts/ci-accelerator/Chart.yaml;
    • VERSION= in scripts/quickstart.sh (the one-node installer installs it; the release attaches the script);
    • in README.md: the status line, the quickstart’s download links (releases/download/v<v>/...), helm install ... --version <v>, the one-node upgrade command (it runs the Helm that HELM_VERSION= in scripts/quickstart.sh installs) and the GitLab CI component’s include (.../ci-accelerator/v<v>/ci/gitlab/build.yml);
    • the component’s include lines in ci/gitlab/README.md;
    • when HELM_VERSION= in scripts/quickstart.sh changed: the Helm path in docs/upgrading.md (the README’s one-node command is checked, this one is not);
    • the box’s helm install ... --version <v> in integrations/gitlab-runner/README.md (the check refuses an install of another version anywhere in the README, docs/, integrations/ or ci/);
    • the Flux version: and the Argo CD targetRevision: in docs/gitops.md;
    • the ci-accelerator image tag in artifacthub.io/images of charts/control-plane/Chart.yaml and charts/ci-accelerator/Chart.yaml, and the release’s artifacthub.io/changes in the umbrella’s Chart.yaml (Artifact Hub shows them on the version page).

    Then run make chart-docs: it regenerates the charts’ READMEs, whose install commands take the chart’s version (the packaged README is what Artifact Hub shows; make lint fails when they are stale).

    Leave the disk probe’s image tag alone (the default in charts/buildkit/templates/_helpers.tpl) unless the probe program or its image changed: moving it restarts every daemon on upgrade. A Go or base image bump that fixes an advisory in the probe’s image counts as a change: the weekly security run scans the probe’s image while it lags behind (scripts/default-images.sh), so a finding there means the tag moves. If it moves, set UPGRADE_ROLLOUT_EXPECTED=1 in test/e2e/run.sh and say so in the upgrade notes.

  2. In CHANGELOG.md:

    • rename ## Unreleased to ## <v> - <yyyy-mm-dd>;
    • read its Upgrade notes as a user would, and make sure they say what to do;
    • start a new ## Unreleased above it with ### Upgrade notes and None..
  3. Run scripts/check-release-version.sh v<v>. It checks the versions and the changelog entry, and prints the version.

  4. Run make vulncheck and look at .govulncheck-allow and .trivyignore.yaml: a release should not ship with a grace period that a bump can end.

  5. Open the pull request. CI runs what a change touches (ADR-0049); a release pull request changes the charts, so it runs the chart checks on both Helm versions, the component’s tests, every e2e group (including upgrade from <prev>) and the one-node quickstart. The Go tests, the image build and scan and the browser checks run only when it also touches the Go code or the image’s recipe; step 4 covers the advisories either way. Branch protection requires the two aggregating jobs, checks passed and e2e on kind; look at the quickstart run too. Merge it.

To rehearse a minor exactly as users will get it, tag the merged commit v<v>-rc.1 and push the tag (see step 4). The workflow publishes a pre-release. Install it from the registry on a test cluster. Release candidates use the <v> changelog entry.

Terminal window
git switch main && git pull --ff-only
git tag -a v<v> -m v<v>
git push origin v<v>

Tags v* cannot be moved or deleted once pushed. Two settings of the repository close what the workflow cannot: the tag ruleset also restricts creating v* tags (to the maintainers), and immutable releases are on, so a published release’s files cannot be replaced. The workflow:

  • stops unless the tagged commit is on main (or a release-0.N branch, for a patch): a tag on any other commit builds and signs nothing;
  • runs the checks again, checks that the GitLab CI component at the tag on GitHub is the file whose integrity the notes print and, when it changed since the previous release, has a real GitLab (CE at the oldest version the component claims and at the runner’s minor) read it from there (make component-gitlab-test with COMPONENT_URL); a GitLab that refuses it stops the release;
  • packages the three charts (ci-accelerator, buildkit, control-plane) reproducibly (Helm 4, SOURCE_DATE_EPOCH = the commit’s time);
  • builds the ci-accelerator image (every role: controller, web, router, disk probe) for amd64 and arm64 (scripts/build-image.sh, the same build the checks run on pull requests that touch the Go code or the image’s recipe) and pushes it as ghcr.io/hoobiboobi/ci-accelerator:v<v>;
  • pushes the charts to oci://ghcr.io/hoobiboobi/charts and signs all four artifacts with cosign right after, and SHA256SUMS (the quickstart script and the chart archives) as a blob, into SHA256SUMS.sigstore.json;
  • pushes the Artifact Hub repository metadata (artifacthub/*.yml, make artifacthub-metadata);
  • creates the GitHub release with the changelog entry, install and verify instructions, the GitLab CI component’s include with its integrity hash, the chart archives, quickstart.sh, SHA256SUMS, its signature bundle and the digests.

Without registry credentials, with cosign 2.6 or newer (the signatures are Sigstore bundles stored as OCI referrers; older versions answer “no signatures found”):

Terminal window
export HELM_REGISTRY_CONFIG=$(mktemp -d)/registry.json
helm pull oci://ghcr.io/hoobiboobi/charts/ci-accelerator --version <v>
helm pull oci://ghcr.io/hoobiboobi/charts/buildkit --version <v>
helm pull oci://ghcr.io/hoobiboobi/charts/control-plane --version <v>
sha256sum ci-accelerator-<v>.tgz buildkit-<v>.tgz control-plane-<v>.tgz # compare with SHA256SUMS of the release
for ref in charts/buildkit:<v> charts/control-plane:<v> charts/ci-accelerator:<v> ci-accelerator:v<v>; do
cosign verify ghcr.io/hoobiboobi/$ref \
--certificate-identity https://github.com/hoobiboobi/ci-accelerator/.github/workflows/release.yml@refs/tags/v<v> \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
done
docker pull ghcr.io/hoobiboobi/ci-accelerator:v<v>
# the release's files, through their signed checksums
curl -fsSLO https://github.com/hoobiboobi/ci-accelerator/releases/download/v<v>/SHA256SUMS
curl -fsSLO https://github.com/hoobiboobi/ci-accelerator/releases/download/v<v>/SHA256SUMS.sigstore.json
cosign verify-blob SHA256SUMS --bundle SHA256SUMS.sigstore.json \
--certificate-identity https://github.com/hoobiboobi/ci-accelerator/.github/workflows/release.yml@refs/tags/v<v> \
--certificate-oidc-issuer https://token.actions.githubusercontent.com

About half an hour later Artifact Hub lists the version with the Signed badge and the verified publisher mark. It checks the signature once, when it first indexes the version (every half hour), and never again for the same digest; the workflow therefore signs right after the push. A version indexed inside that window stays unsigned there for good (0.2.1 did; cosign verify is what counts).

Then check the release the way a user installs it on one machine: run the Quickstart workflow by hand with the release’s version (gh workflow run quickstart.yml -f release=<v>). It downloads quickstart.sh from the release, checks it against SHA256SUMS and installs from the registry on a clean runner.

A package pushed for the first time is private: make it public under the repository’s Packages. Artifact Hub lists two charts, the box and the daemons’ chart (artifacthub/ci-accelerator.yml, artifacthub/buildkit.yml); the control plane’s chart is published on ghcr.io only, since it is of no use without the daemons, and has no Artifact Hub entry. Then install the umbrella from the registry on a kind cluster and run a build, as the README quickstart does.

Open a pull request that moves the upgrade test to the new release. In test/e2e/run.sh, set:

  • UPGRADE_FROM=<v>;
  • UPGRADE_FROM_SHA256 and UPGRADE_FROM_BUILDKIT_SHA256 to the ci-accelerator and buildkit lines of the release’s SHA256SUMS;
  • add the line v<v>: <the ci-accelerator image's digest from the release notes> to the released images in both charts/buildkit/templates/_helpers.tpl and charts/control-plane/templates/_helpers.tpl (a digest pinned for one release is refused under another’s tag; make lint checks both lists agree and hold UPGRADE_FROM, and the upgrade scenario installs the release pinned to it);
  • UPGRADE_ROLLOUT_EXPECTED back to 0, unless main already holds a change that restarts the daemons on purpose;
  • test/e2e/box-values-old.yaml to what the new release needs on kind (tolerations for what runs on the control-plane node, small volumes). From 0.2.x the scenario checks the refusal and the reinstall; from 0.3.0 on it upgrades in place and rolls back. UPGRADE_FROM_DIR and UPGRADE_FROM_VALUES rehearse the in-place path against a packaged tree before a release.

From then on every change is tested against the version users have. Until it is done, make lint fails wherever the repository’s tags are at hand (the checks fetch them): test/released-images.sh wants the newest final release tag to be UPGRADE_FROM.

When main already contains changes that must not ship in the patch:

Terminal window
git switch -c release-0.<n> v0.<n>.<last patch> # once per minor
git cherry-pick -x <commit from main> # the fix lands in main first

Then follow steps 2 to 6 on that branch (pull request into release-0.<n>, tag on it). The e2e and quickstart workflows run on pull requests into main only; on the release branch start them by hand (a run on demand runs everything): gh workflow run e2e.yml --ref release-0.<n> and gh workflow run quickstart.yml --ref release-0.<n>. The changelog entry of the patch also goes into main.