Skip to content

ci: keep a release pull request for the plugins, and tag what it releases - #21

Open
rosylilly wants to merge 1 commit into
mainfrom
ci/release-pr
Open

rosylilly wants to merge 1 commit into
mainfrom
ci/release-pr

Conversation

@rosylilly

Copy link
Copy Markdown
Member

Summary

Like release-please, but it decides what to release from the import graph, as CI does, not from file paths. A change to internal/ releases the plugins that build it.

  • tools/release (new): release plan | prepare | tags

    • plan / prepare go over each plugin:
      • It finds the plugin's highest tag, plugins/<name>/v*.
      • It checks whether the image changed since that tag (affected.Release). If it did, it takes the next version from the Conventional Commits that reach the image (affected.Scope).
      • prepare writes that version, with those commits, to plugins/<name>/CHANGELOG.md, and writes the title and body of the pull request.
      • A plugin never released gets 0.1.0 and "First release."
    • tags: lists each version at the top of a CHANGELOG.md that has no tag yet. A version that comes before the plugin's last release is an error.
  • .github/workflows/release-pr.yml (new): runs on each push to main, as the release App (the release environment, main only).

    1. Creates the tags that release tags lists, on the pushed commit, through the API. Each tag starts release.yml (ci: release each plugin as its container image, from a tag #20), which publishes the image.
    2. Runs release prepare, commits the changelogs as the App, force-pushes them to release/plugins, and opens or updates the pull request. With nothing to release, it closes the pull request.

    The App pushes the branch, so CI runs on the pull request. The pull request changes only Markdown, so gate passes without building anything.

  • affected:

    • Adds Release and Scope. What changes an image is narrower than what CI tests: a change to tests, testdata/, plugin.yaml, or the harness changes no image. .dockerignore and .tool-versions are the exceptions: they change every image.
    • Compute behaves as before. Its analysis of which code changed moves into build.code, which both use.

Versions

Commits since the last release Next version
a breaking change (!, BREAKING CHANGE:) major; minor before 1.0.0
a feat minor
anything else that reaches the image (fix, chore(deps), …) patch
any, after 0.2.0-rc.1 0.2.0

To release another version (a pre-release, or 1.0.0), edit the first heading of the plugin's CHANGELOG.md in the release pull request before merging it. To leave a plugin out, revert its CHANGELOG.md there. The README covers this in its Releases section.

Verified

Go 1.27.4 could not be downloaded in this session, so the tests below ran with Go 1.24, in a copy of tools/ with its go.mod lowered and no dependencies. The code uses nothing newer.

  • go vet and go test -race pass for affected and release:
    • every existing test of Compute;
    • new tests of Release (tests, testdata, plugin.yaml, CI and Markdown change no image; code, a Dockerfile, a dependency and .dockerignore do) and Scope;
    • versions (parsing, the precedence order of SemVer §11, bumps) and commit parsing;
    • changelog writing;
    • a run on a repository that goes from first release, through merge and tags, to a patch, a minor version and a pre-release.
  • release plan, prepare and tags, run end to end on a sample repository, write the changelog, the body and the title, and list the tag.
  • gofmt and actionlint (with shellcheck) pass.

Not verified

  • The workflow has not run yet. Its first real run is the merge of this PR.
  • That a tag ref created through the API, with the App's token, starts release.yml. GitHub sends a push event for refs created that way, but this has not been tried in this repository.

After merging

The first run opens a release pull request for all three plugins at 0.1.0. None has a tag yet. If you want to release only ffmpeg first, revert the other two CHANGELOG.md files in that pull request just before merging it.

create-github-app-token deprecates app-id in favour of client-id. This PR uses app-id (vars.RELEASE_APP_ID), which works as it is. To move to client-id, add the App's Client ID as a variable and change one line.


Generated by Claude Code

…ases

tools/release lists the plugins whose image changed since their last tag,
with their next version from the Conventional Commits that reach the image,
and writes those versions to their CHANGELOG.md. The release-pr workflow keeps
one pull request of that, from release/plugins, as the release App; once
merged, it tags each version at the top of a changelog that has no tag yet,
and each tag publishes the plugin's image through the release workflow.

What changes an image is narrower than what CI tests, so affected gets
Release and Scope: a change to tests, to plugin.yaml, or to the harness but
.dockerignore and .tool-versions changes no image. Compute is unchanged; its
code-change analysis moves into build.code, which both use.

Before 1.0.0, a breaking change moves the minor version, as a feature does;
after a pre-release, the next version is its release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TcfE6PB6wKbbToXs5fq58g
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.

2 participants