ci: create a GitHub release for each published package - #649
Open
tonyandrewmeyer wants to merge 5 commits into
Open
ci: create a GitHub release for each published package#649tonyandrewmeyer wants to merge 5 commits into
tonyandrewmeyer wants to merge 5 commits into
Conversation
…notes The Publish workflow tags releases but never creates a GitHub Release, so dependabot has no per-package release notes to render when it opens a bump PR and falls back to showing the whole monorepo diff. Add an extract-changelog.py helper that pulls a single version's section out of a package CHANGELOG.md, thread the version through the unify-publish-inputs matrix, and wire a Create GitHub Release step into the publish workflow after the tag push.
The parsing is the fragile part -- a heading format it doesn't expect means an empty or wrong release body -- so pin the behaviour: first, middle and last sections, a missing version, exact rather than prefix matching, post releases, a heading with no date, and subheadings.
james-garner-canonical
requested changes
Aug 31, 2026
james-garner-canonical
left a comment
Collaborator
There was a problem hiding this comment.
If we're going to consume changelogs on release, then the CI that checks that a library that will be released has modified its changelog should also (or instead?) check that we can parse out the block we need at that time.
We don't enforce a changelog format currently, perhaps we should -- we can rewrite any existing changelogs that need to be standardised in per-codeowner PRs that land before the CI change.
Comment on lines
+111
to
+113
| gh release create "${TAG}" \ | ||
| --title "${TAG}" \ | ||
| --notes-file "${notes_file}" |
Collaborator
There was a problem hiding this comment.
I think gh release create will create and push the tag, so this step could replace the Tag step, but that probably needs to be verified in a test repo.
The publish workflow feeds a CHANGELOG section to gh release create. If the heading doesn't match what the extractor looks for, that fails at release time, when the package has already been built. Parse it in the same job that checks the changelog was updated, so it fails on the PR instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019e4ws34Es9T8rKzwu3zW93
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M9XjwzMSP5qVzPxtNZiwwQ
The extractor only understood "# <version> - <date>", which is what most packages use. The interfaces packages open with a prose "# Changelog" and put versions at H2, and otlp and sloth follow Keep a Changelog and bracket the version. Releasing any of those would have produced no notes and a non-zero exit. Match a heading at any level whose first word, brackets stripped, is the version, and end its section at the next heading of the same level or shallower, so subheadings inside a Keep a Changelog entry are kept. Every publishable package's current version now extracts, apart from snap, which is on 2.0.0.dev0 with no matching heading yet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M9XjwzMSP5qVzPxtNZiwwQ
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.
Dependabot has nothing useful to show for a charmlibs bump because the Publish workflow tags each release but never creates a GitHub Release for the tag.
project.urls.Changelogpoints at the full CHANGELOG.md, which isn't version specific either.So this adds a "Create GitHub Release" step after the existing Tag step, with the body taken from that package's own CHANGELOG section.
.github/extract-changelog.pyprints the block from# <version> - <date>up to the next#heading, and exits non-zero if the version isn't there, so a missing entry fails the release rather than publishing an empty one.unify-publish-inputs.pynow carriesversionthrough the matrix, which it previously only used internally.It would be interesting to extend the release notes beyond the changelog, which may be quite similar to the Git log, but I'm not sure we are ready to introduce an LLM summary with no gating on the test.
I can't exercise the workflow from a PR, since it only runs on push to
main, so the release-creation step itself is unverified.Fixes #427