ci: publish our GoTrue image to ghcr.io/cap-go/auth on v*-capgo* tags
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 acapgo/*commit (usually-capgo.N, e.g.v2.199.0-capgo.1):- Builds the repo
Dockerfileforlinux/amd64andlinux/arm64, the same way upstream'spublish.ymldoes:sedputs the version in place ofRELEASE_VERSION=unspecified, then QEMU and buildx run. - Pushes
ghcr.io/cap-go/auth:<tag>. Nolatest. - Checks that
auth versionin the pushed image prints the tag.
- Builds the repo
- 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+buildsuffixes are refused. - Auth:
GITHUB_TOKENwithpackages: 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-rc1and rejectsv2.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
sedreplacement matches the currentDockerfileline - This PR's
Capgo imagerun builds the amd64 image andauth versionprintsv0.0.0-capgo.pr<N> - After merge: the tag run pushes
ghcr.io/cap-go/auth:v2.199.0-capgo.1with 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
Dockerfilefor amd64 and arm64 and pushesghcr.io/cap-go/auth:<tag>; nolatesttag. - PRs into
capgo/*build the amd64 image and verifyauth versionwithout 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_TOKENwithpackages: 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.