Repository navigation
ci: release automatically from conventional PR titles - #180
Merged
Merged
Conversation
KartikP
force-pushed
the
kp/auto-release
branch
from
October 8, 2026 20:52
83860bc to
3e3963d
Compare
PyPI trusted publishing does not work from inside a reusable workflow, so callers get a released output and run the publish job themselves.
This was referenced Oct 8, 2026
KartikP
marked this pull request as ready for review
October 9, 2026 09:47
KartikP
added a commit
to brain-score/vision
that referenced
this pull request
Oct 9, 2026
Makes vision releases fully automatic, using the shared workflows added in brain-score/core#180. **Depends on brain-score/core#180.** Both workflows here call `brain-score/core/.github/workflows/*.yml@main`, which do not exist until that PR merges. Do not merge this first. The human setup steps (GitHub App, org secrets, `pypi` environment, ruleset, PyPI trusted publisher) are in the setup guide and are not part of this PR. ## Changes - `release.yml` (new): on each push to `master`, calls core's reusable release workflow with `release-paths: ^brainscore_vision/(?!(models|benchmarks|data|metrics)/)`, so plugin-only merges never release. The PR title type picks the level (`feat` minor, `fix`/`perf` patch, major only with `!` or `BREAKING CHANGE` plus the `major update` label). The PyPI publish job runs in this file, because PyPI trusted publishing does not work inside a reusable workflow. A manual **Run workflow** with a `level` input cuts the first release. - `pr-title.yml` (new): calls core's PR-title check; it comments on a bad title with the allowed types. - `bump_version.yml` deleted (already disabled; its last runs failed in June). Its secrets `APPROVAL_TOKEN` and `WORKFLOW_AUTOMERGE` can be deleted after merge. - `pyproject.toml`: `[tool.bumpversion]` replaced by `[tool.semantic_release]`. - `docs/source/modules/version_bumping.rst` describes the new process. ## Starting version PyPI has 2.3.22, `pyproject.toml` says 2.3.22, and the tag `v2.3.23` exists on an unmerged bump branch but was never published. python-semantic-release takes the highest `vX.Y.Z` tag in the repository, even one not on `master`, so the next versions are 2.3.24 (patch) or 2.4.0 (minor); it never re-creates `v2.3.23`. Tested locally with python-semantic-release 10.7.0 on a scratch repo with the same tag layout. Recommended first release: manual run with level **minor**, giving **2.4.0** (master has 127 commits since 2.3.22, including new helpers). 2.3.23 stays a gap on PyPI.
KartikP
added a commit
to brain-score/language
that referenced
this pull request
Oct 9, 2026
Makes language releases fully automatic, using the shared workflows added in brain-score/core#180. **Depends on brain-score/core#180.** Both workflows here call `brain-score/core/.github/workflows/*.yml@main`, which do not exist until that PR merges. Do not merge this first. The human setup steps (GitHub App, org secrets, `pypi` environment, ruleset, PyPI trusted publisher) are in the setup guide and are not part of this PR. ## Changes - `release.yml` (new): on each push to `main`, calls core's reusable release workflow with `release-paths: ^brainscore_language/(?!(models|benchmarks|data|metrics)/)`, so plugin-only merges never release. The PR title type picks the level (`feat` minor, `fix`/`perf` patch, major only with `!` or `BREAKING CHANGE` plus the `major update` label). The PyPI publish job runs in this file, because PyPI trusted publishing does not work inside a reusable workflow. A manual **Run workflow** with a `level` input cuts the first release. - `pr-title.yml` (new): calls core's PR-title check; it comments on a bad title with the allowed types. - `pyproject.toml`: adds `[tool.semantic_release]`. ## Starting version PyPI and `pyproject.toml` are at 2.2.1, and `v2.2.1` is the highest tag and is on `main`, so the first release is 2.2.2 (patch) or 2.3.0 (minor) with no collision. Pick the level for the manual first run from what `main` has gained since 2.2.1.
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.
Every qualifying merge to
mainis versioned and published automatically. There is no bump PR, no approval step and no personal access token.Release rule (
.github/workflows/release.yml, one decision per squash merge)brainscore_core/or the[project] dependenciesinpyproject.toml. Changes only to tests, docs,.github,*.md,sqlite3.dband so on never release, whatever the title says.featgives a minor release;fixandperfgive a patch. Every other allowed type gives no release:refactor,docs,test,ci,chore,build,plugin,model,benchmark,data,metric.!in the title or aBREAKING CHANGEfooter, and themajor updatelabel on the PR. Without the label it is downgraded to minor.The workflow computes the level and passes it to python-semantic-release as a forced bump (
force: patch|minor|major). python-semantic-release then:versioninpyproject.toml;chore(release): X.Y.Zwith the skip-ci marker;vX.Y.Zand pushes tomainwith a GitHub App token (actions/create-github-app-token);A separate
publishjob in thepypienvironment uploads withpypa/gh-action-pypi-publishthrough trusted publishing (id-token: write, no stored PyPI token).The level is forced rather than left to python-semantic-release, because it would otherwise read every commit since the last tag, and a skipped
feat(for example, a tests-only merge) would leak into the next release.chore(release):.workflow_dispatchwith alevelchoice is for the first release and for missed ones. Merging this PR does not release by itself, because it changes no shipped file. Cutting 2.4.0 (feat feat(metadata): add shared schema and publication safeguards #172, feat(metadata): merge scoring output into existing metadata #177 and feat(metadata): add dataset and license vocabularies #178 since v2.3.8) is one manual run withminor.PR title check (
.github/workflows/pr-title.yml,amannn/action-semantic-pull-request)pull_request_target(opened, edited, synchronize, reopened, labeled, unlabeled), so fork PRs get it too. It never checks out PR code, and its only permission ispull-requests: write.type(scope): subjectformat and three examples.major updatelabel.Reuse: both workflows also declare
workflow_call. Vision and language call them frommain(secrets: inherit), and their only setting is therelease-pathsregex. For vision, for example:^brainscore_vision/(?!(models|benchmarks|data|metrics)/), so plugin-only PRs never release.Local checks
featunderbrainscore_core/featonly undertests/fixdocsin the packagebuild(deps)fix(deps)changing dependenciespyprojecteditfeat!without the labelfeat!with the labelplugin--noopon current main: forced patch gives 2.3.9, minor gives 2.4.0, major gives 3.0.0.model_helpers/and__init__.pyas shipped, and excludesmodels/,benchmarks/andmetrics/.pull_request_targetread frommain). Jenkins andmetadata-contract.ymlare unchanged.Before merging, complete the one-time setup in the hive note
shared/core_auto_release.md: the App, the secrets, a ruleset with the App as bypass and the title check required, squash-only merging with the PR title, and the PyPI trusted publisher.