Make the tagged-release path actually work on Gitea #65
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
vaultik cannot currently cut a tagged release. Three independent problems.
1. goreleaser is configured for GitHub, but the repo is on Gitea
git remote -visgit@git.eeqj.de:sneak/vaultik.git..goreleaser.yamlhas a
release:block (line 54) with nogitea_urls:section, sogoreleaser defaults to the GitHub API and
goreleaser releasewill failor publish to the wrong place. This is the hardest blocker on the release
path.
2. No tags exist, and the version string is contradictory
git tag -lis empty, so goreleaser cannot derive{{.Version}}andonly
--snapshotmode can run today. Meanwhile four sources disagree:Makefile:4VERSION := 1.0.0-rc.1TODO.md:54TODO.md:13internal/globals/globals.go:10-19devmake vaultikbakes1.0.0-rc.1into every local build regardless of gitstate, so a dev binary misreports its own version.
3. No release automation
.gitea/workflows/contains onlycheck.yml. Releases would be cut byhand from a laptop.
goreleaseris also not installed byscript/bootstrap.Definition of done
.goreleaser.yamlhas a correctgitea_urls:block pointing athttps://git.eeqj.de/api/v1(and the matching download URL), sogoreleaser releasepublishes to the Gitea release API.Makefileconstant. An untagged build reports something honest (
devplus commitsha), not a fabricated
1.0.0-rc.1.vaultik versionon a taggedbuild prints that tag.
TODO.md, theMakefile, andinternal/globalsno longer contradicteach other about the version.
.gitea/workflows/release.ymlruns goreleaser with ascoped Gitea token, so releases are reproducible from CI rather than a
workstation. Document the required secret.
script/bootstrapinstallsgoreleaser, andmake release/make release-snapshotbecome thinscript/shims like every othertarget, per the scripts-to-rule-them-all pattern the README describes
at :559-587. They are currently the only Makefile targets that are not
shims.
make release-snapshotsucceeds end to end, producing archives forlinux,darwin x amd64,arm64with checksums.make checkgreen.Explicitly out of scope
Artifact signing, SBOM generation, and reproducible-build settings — file
separately if wanted for 1.0. Shipping shell completions and a man page in
the release archive is covered by its own issue.
Implementation plan (branch
fix-release-pipeline, PR againstmain):.goreleaser.yaml— add a top-levelgitea_urls:block (api: https://git.eeqj.de/api/v1,download: https://git.eeqj.de) so the release publishes through the Gitea release API instead of defaulting to GitHub.Version from git, not a constant — new
script/version(a sibling ofscript/projectname) is the single source of the version string:HEADis exactly on a tag: print that tag with a leadingvstripped, so amakebuild and a goreleaser build of the same commit report the identical string (goreleaser's.Versionstrips it, and the archive names use it).dev-<12-char sha>, plus-dirtywhen the tree is dirty. Nothing fabricated.Makefile:4VERSION := 1.0.0-rc.1becomesVERSION := $(shell script/version).internal/cli/version.gocurrently gates its "this is a development build" notice onglobals.Version == "dev"exactly; that becomes aglobals.IsDevBuild()predicate so the notice still fires fordev-<sha>. Goreleaser'ssnapshot.version_templateis changed from{{ incpatch .Version }}-next(which invents a version number from a tag that does not exist) to the same honestdev-<shortcommit>shape.Consistency — with the
Makefilederiving from git, the remaining contradiction isTODO.md, which says both "cut v0.1.0" and "pre-1.0" while the issue milestone is 1.0.0.TODO.mdgets updated in the same commit per its own Workflow section, and its next step will name the milestone rather than a second, different version number.internal/globalskeepsdev/unknowndefaults, which are already honest..gitea/workflows/release.yml— triggered onpush:ofv*tags,actions/checkoutpinned by commit sha withfetch-depth: 0(goreleaser needs full history and tags), thenscript/releasewithGITEA_TOKENfrom a repo secret. The required secret name will be documented inREADME.mdalong with the token scopes it needs.script/bootstrapinstalls goreleaser;make release/make release-snapshotbecome shims. PerREPO_POLICIES.md, the install is a specific GitHub release archive verified against a hardcoded sha256 — nevercurl | sh, never@latest.script/bootstraphard-fails without Docker (by design, since it gatesscript/lint), and the release runner should not need Docker, so the installer lives in its own idempotentscript/install-goreleaserthatscript/bootstrapcalls and the release workflow calls directly.script/releaseandscript/release-snapshotresolve the binary the same wayscript/lintresolves its linter: an exact-pinned-versiongoreleaseronPATHis used, otherwise the repo-local installed copy, otherwise a loud failure namingscript/bootstrap./dist/gets gitignored.Verification —
make release-snapshotend to end (4 archives +checksums.txt),vaultik versionfrom an untagged build,make checkandscript/cibuild.Out of scope per the issue and confirmed with the requester: signing, SBOM, reproducible-build settings, completions, man page. No git tag will be created or pushed; tagging is the owner's call, so version derivation is exercised via
--snapshotand by inspecting the resolved ldflags.Implemented in PR #104 (branch
fix-release-pipeline, one commit).All seven definition-of-done items are done. The full writeup is on the PR; the short version:
.goreleaser.yamlhasgitea_urls:(api: https://git.eeqj.de/api/v1,download: https://git.eeqj.de).script/versionderives the version from git — exact tag with a leadingvstripped, elsedev-<12-char sha>, with-dirtyon modified tracked files.Makefile:4now calls it. goreleaser's snapshot template stopped inventing a release number too ({{ incpatch .Version }}-nextbecame the samedev-<sha>).Makefile,internal/globalsandTODO.mdnow agree;TODO.md's next step names one version target instead of a third one..gitea/workflows/release.ymltriggers onv*tags withfetch-depth: 0, and needs one repository Actions secret:RELEASE_TOKEN, a Gitea token withwrite:repositoryscope, passed to goreleaser asGITEA_TOKEN. Documented in the newREADME.md"releasing" section.script/install-goreleaserinstalls the pinned v2.17.1 from a sha256-verified archive and is called byscript/bootstrap;make release/make release-snapshotare now shims toscript/release/script/release-snapshot.make release-snapshotsucceeds: four archives (linux,darwinxamd64,arm64) pluschecksums.txt.make checkgreen (14ok, none cached,0 issues.), andscript/cibuildexits 0 with the three check layers actually executing.One consequence found while doing this and worth a look on review:
internal/cli/version.gogated its development-build notice on the version being exactlydev, so as soon as untagged builds carried a commit sha the notice would have gone quiet and an unreleased binary would have read as a release. That gate is now a tested predicate.No tag was created or pushed — tag handling was exercised in a throwaway repository instead, since cutting the tag is yours to do.