Karyo
Documentation/ Decision records

ADR 0056: A release publishes only from a pushed tag

Karyo 2.1.1rendered at build time
On this page

Status: Accepted

Context

A Karyo release is a tag, two images and a GitHub release with evidence (releasing). Until the release workflow existed, every part of that was manual: the images were built by whoever ran Karyo, the --prove double build was run by hand or not at all, the nginx image was never scanned, and the front-end SBOMs were a documented command. None of it had been done for a tag.

Publication is the one step that cannot be taken back cleanly. A pushed image can be deleted, but not un-pulled, and a published tag never moves. The owner decided on 2026-09-24 how 2.0.0's images are distributed: private packages on GHCR named ghcr.io/voyagerforge-dev/karyo-app and ghcr.io/voyagerforge-dev/karyo-nginx, tagged with the version only and no latest, a v2.0.0-rc.1 rehearsal first, and the images promised to approved readers only once an invited read-only account has proven a pull (ADR 0032). The owner first also chose GitHub artifact attestations for provenance, and later dropped them for 2.0.0 (see Decision).

Three facts of this repository bound the design. Every CI job runs on the single self-hosted nebula runner with rootless Podman, one job at a time (the delivery pipeline). A workflow_dispatch run accepts a tag as its ref, so a guard that reads only the ref can be satisfied by a manual run. And the organisation is on GitHub Team with a private repository, where an environment's required reviewers and wait timers are not available: GitHub offers them only for public repositories on that plan. The same holds for artifact attestations, which a private repository gets only on GitHub Enterprise Cloud.

Base images were taken by tag on every build, so two builds at the same moment matched, while a rebuild of the same tree a month later would not (ADR 0023).

Decision

  • .github/workflows/release.yml is the only thing that publishes, and only for a pushed v* tag. Its two publishing jobs test the event and the ref together; a dispatch has no input that turns publication on. A dispatch is a dry run by construction: it runs every build, proof and scan a tag would, and skips the push and the draft.
  • Who may tag is guarded outside and inside the workflow. A tag ruleset on v* lets only the owner create, update or delete a release tag, and every job holding a write token first checks that the actor and the triggering actor are listed in the repository variable KARYO_RELEASE_ACTORS, failing when it is unset. No GitHub environment is part of the guard.
  • A tag must be the release it names. It is annotated, names exactly the version in build.gradle.kts and both front-end manifests, points at the checked-out commit and is on main; anything else fails before a build starts.
  • What is pushed is what was proved and scanned. Both images are built twice from the same tree with every input restamped in between, and must give identical image IDs; both are scanned with Trivy at CRITICAL and HIGH with --exit-code 1; the scanned tarballs are the ones pushed, and publish checks their image IDs against the build's before pushing. A version tag either package already has is never overwritten.
  • Base images are pinned per release. The workflow resolves each base tag the Dockerfiles declare to the linux/amd64 manifest digest it pulled, builds from those digests and records them, with the installed Alpine package lists, in the evidence.
  • Least privilege, split by job. The workflow's floor is contents: read. publish alone holds packages: write; draft-release alone holds contents: write. The workflow opens the GitHub release as a draft and never publishes it.
  • The release runs where CI runs: on nebula, with Podman.
  • No attestation for 2.0.0. GitHub artifact attestations are unavailable for a private repository on the Team plan, so the workflow makes none. A release publishes the image digests, the three SBOMs, the Trivy reports and evidence.txt, and a user verifies an image by pulling it by the digest the release records.

Consequences

  • A release can be rehearsed in full, short of publication, by one dispatch on the commit to be tagged; its evidence artefact is the record of the build, the proofs, the scans and the SBOMs.
  • What a dispatch cannot prove - the push, the package visibility and access, the registry quota and the draft - is proved only by a real tag, which is why a pre-release tag precedes 2.0.0.
  • Until the owner sets KARYO_RELEASE_ACTORS, no tag can publish, whoever pushes it.
  • The reproducibility claim is scoped: the tagged tree rebuilds to the same images from the recorded base digests, but the apk upgrade layer reads Alpine's package feed at build time, so a later rebuild is checked against the recorded package lists, not assumed identical.
  • A run occupies the single runner for its whole length and spends Actions minutes, so only a tag or a deliberate dispatch starts one.
  • Neither attestations nor Sigstore cosign signatures are made. Provenance is the recorded digest and the evidence. Attestations can be added if the repository goes public or the plan changes.

Alternatives considered

  • A GitHub-hosted runner. Not taken: every job of this repository runs on nebula, and a second build environment would release images built somewhere CI never builds them.
  • A GitHub environment with a required reviewer as the guard. Not available for a private repository on GitHub Team. The tag ruleset and the actor check work on this plan.
  • A dispatch input that publishes. Rejected: it would make a manual run one click from a publication, which is the case the event test exists to rule out.
  • Publishing from the build job. Rejected: that job would hold the package write token while it runs every build and scan; the split keeps the token in a job that only loads, checks and pushes.
  • Rebuilding the images in the publishing job. Rejected: the pushed image would not be the scanned one, and a rebuild later in the run could take a different apk upgrade layer.
  • Public packages, or a latest tag. Rejected by the owner's 2026-09-24 decision: the packages are private, and a moving tag contradicts a tag that never moves.

Evidence

  • .github/workflows/release.yml, on, concurrency, permissions, env.PUBLISHING - the triggers, the never-cancelled tag run, the read-only floor and the publication flag
  • .github/workflows/release.yml, jobs.prepare.steps: The actor may release, The tag, the version fields and main agree - the actor and tag checks
  • .github/workflows/release.yml, jobs.build.steps: Resolve the base images to digests, Build the application image twice, Build the web image twice, Scan both images - the pins, the proofs and the scans
  • .github/workflows/release.yml, jobs.publish, jobs.draft-release - the guarded publishing jobs and their permissions
  • infrastructure/docker/Dockerfile.service, ARG JRE_BASE_IMAGE and infrastructure/docker/Dockerfile.nginx, ARG NODE_BASE_IMAGE, ARG NGINX_BASE_IMAGE - the base images, named once
  • scripts/check-image-reproducibility.sh, BUILD_SITES - the release workflow as an audited build site
  • tests/e2e/fixtures/release-workflow.test.ts - the guard, held by a test