ci: gitea publishes Harbor on tag, github does the rest - #5
Open
ashish1099 wants to merge 1 commit into
Open
Conversation
Gitea is a mirror now, so it keeps only the one job GitHub cannot do: push the container image to Harbor on a v* tag. Tests, lint, fmt, the GitHub release and the GHCR image all live on GitHub. Image building moves back to docker/build-push-action. d4c49bf moved it into GoReleaser's dockers: block, but GoReleaser builds in a temp dir holding only the compiled binaries and the Dockerfile, while this Dockerfile builds from source - so go.mod is absent and the build cannot succeed. No release workflow had ever run, so the regression went unnoticed. Along the way: Gitea's Login to Harbor step ran setup-go instead of docker/login-action, so no login happened; the GitHub release had no registry login at all; the GHCR image template resolved to ghcr.io/Obmondo/gfetch/gfetch (doubled path segment, and uppercase, which GHCR rejects) while the published image is ghcr.io/obmondo/gfetch; and neither workflow set up QEMU/buildx for the declared linux/arm64 build. .goreleaser-gitea.yaml is dropped, since GoReleaser no longer runs on Gitea. Signed-off-by: Ashish Jaiswal <ashish@obmondo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Splits release responsibilities now that
originpoints at GitHub and Gitea is a mirror:.github/workflows/test.ymlharbor.obmondo.com/obmondo/gfetchghcr.io/obmondo/gfetch.github/workflows/release.ymlv*tag onlyv*tag (release), push/PR (CI)Gitea keeps exactly one job — the Harbor push, which GitHub cannot do — and nothing else.
Why the release workflows also needed fixing
d4c49bf("unify build and release process with goreleaser") moved image building out ofdocker/build-push-actionand into GoReleaser'sdockers:block. That cannot work here:GoReleaser builds images in a temp directory containing only the compiled binaries plus the
Dockerfile, but our Dockerfile builds from source (
COPY go.mod go.sum ./thengo build).go.modis not in that context, so the build fails before it starts.It went unnoticed because no release workflow has ever run — GitHub Actions history shows only
TestsandCodeQL, zerogoreleaserruns. The image currently published atghcr.io/obmondo/gfetch:v1.2.0was built by the olddocker.ymlthatd4c49bfdeleted.So image building returns to
docker/build-push-actionwith full repo context, and GoReleaser goesback to what it does well: binaries, archives, changelog, GitHub release.
Bugs fixed along the way
setup-go, notdocker/login-action— a copy-paste slip, so no authentication happened at all..goreleaser-github.yamlhadpush: truetoghcr.io.
ghcr.io/{{.Env.GITHUB_REPOSITORY}}/gfetchresolves toghcr.io/Obmondo/gfetch/gfetch— a doubled path segment, and uppercase, which GHCR rejects.Verified against the registry:
ghcr.io/obmondo/gfetch:v1.2.0returns 200, the doubled name 403s.--platform=linux/amd64,linux/arm64. (An abandoned checkpoint branch in this repo carries thematching
buildx failed ... failed to solveerror.)Judgement call worth a look
.goreleaser-gitea.yamlis deleted. With GoReleaser no longer running on Gitea it is deadconfig — but it also means no more Gitea releases or binary archives; Harbor becomes the only
artifact Gitea produces. That follows "only the tags push for gitea and nothing else", but it is one
revert away if you want Gitea releases kept.
Before this actually works
HARBOR_USERNAME/HARBOR_PASSWORDsecrets, and theobmondoproject must exist inHarbor. I could not verify either from here.
GitHub — if
EnableIT/gfetchis not configured as a Gitea pull-mirror, the tag never lands thereand the Harbor job never fires.
automatically — nothing to change.
Not run:
go build/ tests, per your usual preference. YAML of all workflows was parse-checked.🤖 Generated with Claude Code