ci: publish our GoTrue image to ghcr.io/cap-go/auth on v*-capgo* tags

Merged
WC
3d ago
+134-0

What

A new workflow, .github/workflows/capgo-image.yml, publishes our GoTrue as a Docker image to ghcr.io/cap-go/auth.

  • On a tag v<upstream version>-capgo<anything> pushed on a capgo/* commit (usually -capgo.N, e.g. v2.199.0-capgo.1):
    • Builds the repo Dockerfile for linux/amd64 and linux/arm64, the same way upstream's publish.yml does: sed puts the version in place of RELEASE_VERSION=unspecified, then QEMU and buildx run.
    • Pushes ghcr.io/cap-go/auth:<tag>. No latest.
    • Checks that auth version in the pushed image prints the tag.
  • On a PR into capgo/**: builds the amd64 image without pushing it, and runs the same version check.
  • Tag check: a tag that isn't v<major>.<minor>.<patch>-capgo[0-9A-Za-z.-]* (128 characters at most) fails the job. Docker tags can't hold +, so semver +build suffixes are refused.
  • Auth: GITHUB_TOKEN with packages: write. No new secrets.

Why here and not on master

master stays upstream + README, and our code lives on capgo/v<upstream> branches. For tag pushes and PRs, GitHub runs the workflow file of the commit being built, so this file has to be one of our commits on the capgo/* branches. When we move to a new upstream release, it gets cherry-picked along with our other changes.

Upstream's own workflows (release, publish, test, dogfooding, conventional-commits) are disabled in this repo's Actions settings. They need Supabase's runners and secrets.

Releasing

git tag -a v2.199.0-capgo.2 origin/capgo/v2.199.0 -m v2.199.0-capgo.2
git push origin v2.199.0-capgo.2

After this merges, the first tag will be v2.199.0-capgo.1 on the merge commit. Its Go code is the same as 2002ca4e, which Capgo runs today.

Test plan

  • YAML parses; the tag rule accepts v2.199.0-capgo, v2.199.0-capgo.1, v2.199.0-capgo-rc1 and rejects v2.199.0, v2.199-capgo.1, v02.199.0-capgo, 2.199.0-capgo, v2.199.0-capgo+b1, v2.199.0-capgox_1
  • The sed replacement matches the current Dockerfile line
  • This PR's Capgo image run builds the amd64 image and auth version prints v0.0.0-capgo.pr<N>
  • After merge: the tag run pushes ghcr.io/cap-go/auth:v2.199.0-capgo.1 with amd64 and arm64

Summary by cubic

Adds a CI workflow that builds the GoTrue fork and publishes it to ghcr.io/cap-go/auth when a v*-capgo* tag lands on a capgo/* commit.

  • Builds the repo Dockerfile for amd64 and arm64 and pushes ghcr.io/cap-go/auth:<tag>; no latest tag.
  • PRs into capgo/* build the amd64 image and verify auth version without pushing.
  • Rejects tags not matching v<major>.<minor>.<patch>-capgo<suffix> (max 128 chars); + suffixes are refused because Docker tags can't hold them.
  • Uses only GITHUB_TOKEN with packages: write.

The workflow lives on the capgo/* branches, not master, because GitHub runs the workflow file of the commit being built. Release with git tag -a v<version>-capgo.N <commit> -m <tag> and push it; the first release tag will be v2.199.0-capgo.1 on the merge commit.