Skip to content

ci: create a GitHub release for each published package - #649

Open
tonyandrewmeyer wants to merge 5 commits into
canonical:mainfrom
tonyandrewmeyer:infra/427-github-releases
Open

ci: create a GitHub release for each published package#649
tonyandrewmeyer wants to merge 5 commits into
canonical:mainfrom
tonyandrewmeyer:infra/427-github-releases

Conversation

@tonyandrewmeyer

@tonyandrewmeyer tonyandrewmeyer commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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.Changelog points 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.py prints 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.py now carries version through 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

…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.
@tonyandrewmeyer
tonyandrewmeyer marked this pull request as ready for review August 31, 2026 06:57
@tonyandrewmeyer
tonyandrewmeyer requested a review from a team as a code owner August 31, 2026 06:57

@james-garner-canonical james-garner-canonical left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

tonyandrewmeyer and others added 3 commits September 7, 2026 14:51
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust changelogs/releases so that dependabot understands them

2 participants