~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A release's image is copied to GitHub's registry too, digest and all

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:release/ghcr

After release publishes a version's image to knotless.dev, it now copies that exact image to ghcr.io/bluesky-social/group-host:<version> as well. That also tags latest while the version is the highest. It's one build, so both registries hold the same digest. Running release again on main copies a version published before this landed, such as 0.3.0.

Claude Opus 5.5 · high effort

What changes

  • release.yml:
    • A new ghcr step, on main only:
      • It skips if GHCR_TOKEN isn't set, or if the version isn't published on knotless.dev.
      • Otherwise it logs in as GHCR_USER (bigmoves) and runs crane copy knotless.dev/chadtmiller.com/group-host:<version> ghcr.io/bluesky-social/group-host:<version>, unless that tag is already there.
      • It tags latest when this is knotless.dev's highest version, and prints the digest.
    • Installing crane moves to a step of its own (crane), as the image step and the copy both use it.
  • docs/development.md: "The image" describes the copy, how to seal GHCR_TOKEN, and how to copy a version published earlier.
  • Wording: the GitHub repository is public now, so mirror.yml and AGENTS.md call it "a copy", not "a private copy". AGENTS.md's release line mentions the GHCR copy.

How it was checked

  • The bigmoves login can push to ghcr.io/bluesky-social/group-host. It got a push-scoped token, and GHCR answered a blob upload with 202. Nothing was pushed.
  • The workflow parses as YAML, and just docs reports 0 problems.
  • The step itself first runs on main, once GHCR_TOKEN is sealed.

Shortcomings

  • Token needed: GHCR_TOKEN is a GitHub token with write:packages, made by hand. GitHub won't create one through its API. Until it's sealed, the step prints that and copies nothing.
  • Visibility: the GHCR package doesn't exist until the first copy, and GitHub may create it as private. If so, make it public once in its settings and link it to bluesky-social/group-host.
Approved

This pull adds a ghcr step to release.yml. After publish, on main only, the step copies the published image to ghcr.io/bluesky-social/group-host:<version> with crane copy, which keeps the digest. It tags latest when the version is the highest one. It does nothing if GHCR_TOKEN is unset or the version isn't published. Installing crane moves to its own crane step, so the step that builds the image can still exit early on ~/.done while the copy runs on a rerun for an already-published version. The docs and wording changes in AGENTS.md, mirror.yml and docs/development.md match the change.

I read the whole diff and the final release.yml, and found nothing that must change.

  • The crane step: it has no ~/.done guard. That's intended, since ghcr needs crane when the image was skipped.
  • Skip, don't fail: a missing token or an unpublished version exits 0 in both cases.
  • latest tagging: it uses head -1 of release list. This assumes the list is sorted highest first and that the top entry is the latest. If a pre-release or yanked version ever tops the list, latest would point at it, though knotless.dev wouldn't call it latest. That can't happen while versions come only from knope releases.

I didn't see the step run. It first runs on main once GHCR_TOKEN is sealed, as the body says.

Merged as be9cd67