ci(release): generate the release pull request and publish tagged releases with the tarball #175
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: Mortis/Kamino#175
Reference in new issue
Block a user
Spec: Release automation. Needs the credential from the kamino-release bot account issue for a live run; the code can be written before.
Blocked by #262: this issue edits
docs/contributing/maintaining.md, which #262 creates.What
A new
.gitea/workflows/release.ymlwith two jobs, both on push tomainonly (never on a pull request), both using the release bot's token from its repository secret.prepare
mainwhile fragments that call for a release are pending (not only on pushes that add one), so the release pull request never sits behindmain.concurrency: {group: release-prepare, cancel-in-progress: true}, so an older run cannot force-push last.scripts/(with tests) reads the pending fragments inchangelogs/fragments/and derives the next version from the last release, using the fragment-to-bump function shared with the version check issue (whichever of the two issues lands first creates the module, the other imports it):breaking_changes,removed_features→ majorminor_changes,deprecated_features→ minorbugfixes,security_fixes,known_issues→ patchtrivial(or none) → no release: close any open release pull request and stop.major_changesis not mapped (it leaveschangelogs/config.yaml, see #176).release_summaryfragment with a fixed one-liner, setgalaxy.yml's version, runantsibull-changelog release.release/*is a protected branch, so nobody can delete it and "delete branch after merge" is skipped for it. Reuse the fixed branchrelease/next(force-push onto it), never delete and recreate it, and open, or update, its pull request (chore(release): X.Y.Z) through the Gitea API withcurl.main.publish (converges: runs on every push to
mainand does only what is missing)galaxy.yml's version onmaindiffers from the latestv*tag, or a release is incomplete.main's first-parent history wheregalaxy.yml'sversion:became the version being released. In the normal case it is the pushed commit. When no tag exists, publish builds from and tags the expected commit, never a later one (a first publish that failed before the tag existed can run again on a later push).ansible-galaxy collection build) in a worktree of the expected commit when no tag exists (a worktree of the tag in the repair case below); runcheck_tarball.pyand the tag checks before creating anything.POST /repos/{owner}/{repo}/releases:tag_name: vX.Y.Z,target_commitish= the SHA of the expected commit and atag_message(this makes the tag annotated, sobuild.yml's tag check still holds). Notes:antsibull-changelog generate --only-latest --output-format md. If thev*tag already exists (Gitea creates the tag before the release row, so a failure can leave one), require it to be annotated and point at the expected commit, else fail.POST …/releases/{id}/assets) if the release has no such asset.MANIFEST.json, not the tarball's (ansible-galaxy collection buildis not reproducible, so the tarball's sha256 cannot survive a rebuild).cancel-in-progress: false.check_tarball.py: the sha256 ofMANIFEST.jsonmust equal the value in the tag message,FILES.jsonmust matchMANIFEST.json'sfile_manifest_file.chksum_sha256, and everyftype: fileentry must match its sha256 inFILES.json. Publish runs this check:No knope, no third-party release action:
curlagainst the API, so no third-party code holds the token. Pass refs and names throughenv:, never${{ }}inrun:.Also
scripts/select_molecule_scenarios.py: a diff of only thegalaxy.ymlversion:line pluschangelogs/selects no scenarios (add to IGNORED only if not already handled): a release pull request should run no scenarios.docs/contributing/releases-and-secrets.mdis not created. When the release workflow lands, this issue changes the release text indocs/contributing/maintaining.md(the procedure) anddocs/contributing/making-a-change.md(the contributor half) to "a release happens only by merging the generated release pull request" (contributors write fragments, never the version; the maintainer keeps tag permission as an override).AGENTS.md, per the contributor-doc split and theAGENTS.mdissues that land first, notCLAUDE.md) and inCONTRIBUTING.mdis updated to those homes.README.md("annotatedvX.Y.Ztags pushed by the" maintainer): replace with the generated release pull request, as for the agent context andCONTRIBUTING.md..gitea/workflows/AGENTS.md. Do not restate it elsewhere; check that.gitea/workflows/AGENTS.mdnamesrelease.ymlas live, no longer planned.build_ignore).Acceptance
mainwith aminor_changesfragment opens a release pull request with the next minor version, and its Lint, Build and Molecule run.trivialfragments opens none.vX.Y.Ztag and a Gitea Release with the notes and the tarball;build.yml's tag run passes.FILES.jsonand file were both rewritten fails the job;MANIFEST.jsondiffers from the tag message fails the job.Open proposals
Order: this now waits on the contributor-doc split (#189) where it edits
CONTRIBUTING.md, and on docs(agents): replace CLAUDE.md with a root AGENTS.md (#185): put theCLAUDE.mdedits in the root or nestedAGENTS.mdinstead. (From Order of the implementation backlog, #198.)Review of the map (2026-11-15): corrections to this issue.
image.yml(registry credential) andrelease.yml(release credential) reference secrets, each only its own." That leaves outrenovate.yml, which references its own token (.gitea/workflows/renovate.yml:57). Enforcement map for each prose-only rule restated the rule: "each secret is referenced by exactly one workflow (image.ymlthe push credential,renovate.ymlthe Renovate token,release.ymlthe release token); no other workflow referencessecrets.except the job token". That wording is already in docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs and docs(contributing): split the contributor docs into CONTRIBUTING.md and docs/contributing/, and both land before this issue. Taken as written, this issue would overwrite the correct rule with a false one. Change: drop that bullet, or replace it with "check that.gitea/workflows/AGENTS.mdanddocs/contributing/releases-and-secrets.mdnamerelease.ymlas live, no longer planned".Waiting on another decision: the fragment check's escape for the release pull request, the release branch allowlist, publish recovery and tarball integrity wait on Release path: fragment check, failed publish and tarball integrity.
Spec change from Release path: fragment check, failed publish and tarball integrity. These replace the matching parts of the body.
publish converges (runs on every push to
main, does only what is missing):check_tarball.pyand the tag checks before creating anything.v*tag already exists (Gitea creates the tag before the release row, so a failure can leave one), require it to be annotated and point at the expected commit, else fail.cancel-in-progress: false.Test a rerun after a failed upload: it adds the tarball and nothing else.
prepare
mainwhile fragments that call for a release are pending (not only on pushes that add one), so the release pull request never sits behindmain.concurrency: {group: release-prepare, cancel-in-progress: true}, so an older run cannot force-push last.scripts/select_molecule_scenarios.py: a diff of only thegalaxy.ymlversion:line pluschangelogs/selects no scenarios.Also
README.md("annotatedvX.Y.Ztags pushed by the" maintainer): replace with the generated release pull request, as for the agent context andCONTRIBUTING.md.Review of the map (2026-11-17).
major_changes. The body maps "major_changes,minor_changes,deprecated_features→ minor". It should say: minor isminor_changesanddeprecated_featuresonly;major_changesis not mapped. Decided by Role standard gaps found in review, rule 8. This issue and the version-check issue share one function, so without this fix the result depends on which merges first.ansible-galaxy collection buildis not reproducible (reproduced; the build stamps the current time into two members). Open in What the tarball checksum in the tag message proves when a publish is repaired.Changed: this issue is now blocked by that ticket.
Scope added by Pushes onto a pull request that has a scheduled merge (resolution, points 1 and 4):
release/*is a protected branch, so nobody can delete it and "delete branch after merge" is skipped for it. The prepare job must reuserelease/next(force-push onto it) rather than delete and recreate it. The release pull request is merged with the merge button at the head the maintainer read, never scheduled, because prepare refreshes the branch on every push tomain.Spec change from What the tarball checksum in the tag message proves when a publish is repaired (2026-11-20)
ansible-galaxy collection buildis not reproducible, so the tarball's sha256 cannot survive a rebuild. This replaces the tarball sha256 and the "existing asset that differs" wording from the release-path comment:MANIFEST.json, not the tarball's.check_tarball.py: the sha256 ofMANIFEST.jsonmust equal the value in the tag message,FILES.jsonmust matchMANIFEST.json'sfile_manifest_file.chksum_sha256, and everyftype: fileentry must match its sha256 inFILES.json. Publish runs this check:main's first-parent history wheregalaxy.yml'sversion:became the tagged version. That is "the expected commit".FILES.jsonand file were both rewritten fails the job;MANIFEST.jsondiffers from the tag message fails the job.This issue is no longer blocked by that ticket.
Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
docs/contributing/releases-and-secrets.mdis not created; when the workflow lands this issue changes the release text inmaintaining.md(procedure) andmaking-a-change.md(contributor half) to "a release happens only by merging the generated release pull request"; the "Releases are the operator's…" bullet in the agent context andCONTRIBUTING.mdis updated to those homes..gitea/workflows/AGENTS.md; this issue only checks it namesrelease.ymlas live.MANIFEST.jsonsha256 (not the tarball's), with the chain check, repair-from-tag rule and tests from the #255 comment.major_changesis not mapped (decision 1 of that round, carried by #176).release/nextreuse), hence a full rewrite rather than an edit. The soft-order proposal on the bot account issue is listed under "Open proposals".Final validation round, second pass (2026-11-20): body edited.
main's first-parent history wheregalaxy.yml'sversion:became the released version; normally the pushed commit); the repair bullet refers to it.target_commitish= its SHA), never a later push's commit.docs/contributing/maintaining.md, which #262 creates; one line saying so is in the body.