Repository navigation
ci(release): publish the GitHub release from CHANGELOG.md - #50
Merged
Merged
Conversation
The release notes of a version now live in CHANGELOG.md, written in the version change. Once the release job has published and signed the image and the chart, a github-release job creates the GitHub release of the tag from that section (scripts/release/notes.sh) and an announce job posts it to Discord. Until now the release was created by hand after CI, so a tag could ship without one. github-release is the only job with write access to the repository; the release job keeps its read-only token. make check fails for a chart version without notes (TestChartVersionHasReleaseNotes), so the notes cannot be forgotten. release-announce.yml stays for a release published by hand and for a manual run. The hygiene allowlist entry for the pinned shared workflow now covers every workflow file, since ci.yml calls it too; a branch reference and the same line outside a workflow still hit. CHANGELOG.md starts with v0.16.1, copied from its GitHub release with the group headings one level down.
6 of 7 tasks
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 and why
CI now creates the GitHub release of a tag and announces it, instead of a person doing it after the tag's run. Until now a tag could publish the image and chart and still end up with no release and no announcement.
CHANGELOG.mdholds the release notes, newest first. The section of a version (## vX.Y.Z: headline, then the notes) is written in the version change. It starts with v0.16.1, copied from its GitHub release with the group headings one level down (###); earlier releases keep their notes on GitHub.scripts/release/notes.shprints the title or the notes of a version's section. It refuses a version with no section, with two, or with an empty one, and leaves a##line inside a code block in the notes.ci.ymlgains two tag-only jobs afterrelease:github-releasecreates the release from that section. It is the only job withcontents: write; thereleasejob keeps its read-only token. A re-run leaves an existing release alone.announcecalls the shared release announcement workflow (pinned tof7202aa) to post the release and its notes to Discord. A release made with the workflow's own token starts noreleaseworkflow, so it has to be called here.release-announce.ymlstays for a release published by hand (after a failedreleasejob) and for a manual re-announcement.make checkfails for a chart version without notes (TestChartVersionHasReleaseNotes), so the notes cannot be forgotten before tagging.docs/development.md: the release procedure.Hygiene allowlist
ci.ymlnow names the shared workflow too, so the allowlist entry from #49 covers.github/workflows/*.ymlinstead of one file. The form is unchanged: only that workflow, only pinned to a 40-character commit. The scan test shows a branch reference in a workflow still hits, and so does the same line in a document.I tried two ways to keep a single reference (calling
release-announce.ymlfromci.yml)../…is flagged by zizmor 1.32 (self-repository), and$/…is not accepted by the pinned actionlint 1.7.12, soci.ymlcalls the shared workflow directly, as the other repositories do. Two pins have to move together; both files say so.How it was tested
go test ./internal/hygiene/: the newTestReleaseNotesAreTheVersionsSection(exact version, not a prefix of it; stops at the next version; code-block##kept; missing, duplicate and empty sections refused) andTestChartVersionHasReleaseNotes, plus the lab-identifier scan.github-releasestep run locally withghstubbed: for v0.16.1 it callsgh release create v0.16.1 --verify-tag --title "v0.16.1: usage figures stay in their cards" --notes-file …with the section's text; with an existing release it does nothing; for a version without a section it fails with the script's message.actionlint(the pinned one, and 1.7.12 with shellcheck),zizmor --config .github/zizmor.yml .github,scripts/ci/links.sh offline, shellcheck on the script.announcejob's call is the one that already ran for v0.16.1 fromrelease-announce.yml.Checklist
make checkpasses. (left to CI)make generateand committed. (none affected)