Repository navigation
ci(release): open a release PR and tag the release when it merges - #782
Merged
Merged
Conversation
This was referenced Nov 12, 2026
masquare
force-pushed
the
ci/release-open-pr
branch
from
November 12, 2026 18:05
7b107df to
6f89304
Compare
masquare
marked this pull request as ready for review
November 13, 2026 15:32
✅ CI checks passed
Updated for |
karhu
approved these changes
Nov 13, 2026
karhu
left a comment
Contributor
There was a problem hiding this comment.
again one non-blocking suggestion
masquare
force-pushed
the
ci/release-open-pr
branch
from
November 16, 2026 15:47
46c4cdd to
3ad3df5
Compare
The Release workflow, started by a maintainer on main, sets the version of each package, writes the notes into the PR body between markers, and opens the release PR with a GitHub App token so that CI runs. Merging that PR does nothing yet.
When the release PR is merged to main, the same workflow builds and smoke-tests the wheel and the sdist of each released package, creates the tag and the GitHub release with the notes from the merged PR, and attaches the files. Uploading to PyPI stays with publish.yml for now.
masquare
force-pushed
the
ci/release-open-pr
branch
from
November 16, 2026 17:02
3ad3df5 to
06dd669
Compare
masquare
added a commit
that referenced
this pull request
Nov 18, 2026
**Stack: automated per-package releases.** Review the PRs in this order. Each PR shows only its own layer. 1. #781 Release notes 2. #782 Open a release PR and tag the release when it merges 3. #784 Publish to TestPyPI and PyPI 4. #785 Open the next development version PR `main` keeps working after each merge. Nothing changes how packages are published until #784 deletes `publish.yml`. ## What this PR does Adds the two pieces that write release notes. `cliff.toml` configures git-cliff for the timenet notes. `connector_notes.py` writes the timenet-connectors notes. They list the connectors that were added, changed or removed, and the changes to the shared connector code. Core changes that only touched connector files on the way are left out, because the timenet notes list them. ## Where to look - `cliff.toml`: the commit groups, and the pre-1.0 bump rule (a breaking change or a feature raises the minor version). - `connector_notes.py`: a connector is a `datasets/<org>/<name>/` folder with a `dataset.yaml`. It is matched by `dataset_id`, so a moved folder is a change and a new id is one removal and one addition. A connector PR is a `feat`, a `fix` or a breaking change that did not touch `packages/timenet`. ## Not in this PR No workflow calls these files yet. PR 2 does. ## Example output <details> <summary>Notes for a release of both packages</summary> ```markdown ## timenet 0.21.0 [](https://pypi.org/project/timenet/0.21.0/) ### Features - **test-mean:** Sandbox timenet change 8 (#925) ## timenet-connectors 0.21.0 [](https://pypi.org/project/timenet-connectors/0.21.0/) ### Connector framework - **test-mean:** Sandbox connectors change 8 (#926) ``` </details> ## Testing The whole stack ran end to end in a private sandbox repository. This PR passes ruff, ty and the pre-commit hooks on its own. --------- Co-authored-by: masquare <11543761+masquare@users.noreply.github.com>
masquare
added a commit
that referenced
this pull request
Nov 18, 2026
**Stack: automated per-package releases.** Review the PRs in this order. Each PR shows only its own layer. 1. #781 Release notes 2. #782 Open a release PR and tag the release when it merges 3. #784 Publish to TestPyPI and PyPI 4. #785 Open the next development version PR `main` keeps working after each merge. Nothing changes how packages are published until #784 deletes `publish.yml`. ## What this PR does The release job now keeps the built files as a workflow artifact. A TestPyPI job and then a PyPI job upload those files. Each job waits for approval in the `pypi` environment. The upload jobs build nothing, so the files on PyPI are the files that the GitHub release holds. This PR deletes `publish.yml`. ## Where to look - Both jobs use trusted publishing (OIDC). Their only permission is `id-token: write`, and they do not check out the repository. - `publish-pypi` starts only after `publish-testpypi` succeeds. - `uv publish --check-url` skips files that the index already has, so a re-run after a partial upload sends the rest. ## Setup before you merge On both PyPI and TestPyPI, for both `timenet` and `timenet-connectors`, set the trusted publisher to owner `OpenTSLM`, repository `TimeNet`, workflow `release.yml`, environment `pypi`. Change an existing publisher from `publish.yml`, or add a pending publisher for a new project. The `pypi` environment already has its reviewers. ## Testing The TestPyPI upload ran for real in a private sandbox repository, with dummy projects. The PyPI job ran there with its upload skipped, because the sandbox has no PyPI project. The first real PyPI upload happens with the first release. Co-authored-by: masquare <11543761+masquare@users.noreply.github.com>
masquare
added a commit
that referenced
this pull request
Nov 18, 2026
**Stack: automated per-package releases.** Review the PRs in this order. Each PR shows only its own layer. 1. #781 Release notes 2. #782 Open a release PR and tag the release when it merges 3. #784 Publish to TestPyPI and PyPI 4. #785 Open the next development version PR `main` keeps working after each merge. Nothing changes how packages are published until #784 deletes `publish.yml`. ## What this PR does Right after the release job, a separate job opens a PR that moves each released package to its next development version, for example `0.13.0.dev0`. Then builds from `main` do not look like a release. The PR has auto-merge on, so it merges when it has the approvals that `main` needs. ## Where to look - A package moves on only when `main` still has the released version. A re-run after the merge changes nothing. - The job is separate from the upload jobs, so the App key never runs next to the PyPI token. - It does not wait for PyPI. The tag already fixes the released version, also when an upload fails. ## Setup Turn on the repository setting "Allow auto-merge". It is off now. Without it, the job warns and the PR waits for a manual merge. ## Testing Run end to end in a private sandbox repository. The PR merged by itself 29 seconds after an approval. Co-authored-by: masquare <11543761+masquare@users.noreply.github.com>
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.
Stack: automated per-package releases. Review the PRs in this order. Each PR shows only its own layer.
mainkeeps working after each merge. Nothing changes how packages are published until #784 deletespublish.yml.What this PR does
Adds the
Releaseworkflow. A maintainer runs it onmainand pickstimenet,timenet-connectorsorboth. It opens a release PR that sets the version of each package and holds the release notes in the PR body, betweenrelease-notesmarkers. The notes can be edited in the PR before it is merged.When the release PR is merged to
main, the same workflow builds the wheel and the sdist of each released package, smoke tests them, creates the tag, and creates the GitHub release with the files attached. The release notes are the text between the markers in the merged PR.Where to look
authorizejob: only admins and maintainers can run it.preparejob: it makes a GitHub App token, so CI runs on the release PR.GITHUB_TOKENcannot do that.release.py prepare: the version comes from git-cliff or from the input. It fails if the tag already exists. A release of both packages raises the timenet floor of timenet-connectors. A release of one package warns when the other package has changes that it leaves out.mainwhose commit message starts withchore(release):. A squash merge uses the PR title, so do not edit the title when you merge.released: finds the packages whose version the PR changed.smoke: imports each file in an isolated environment and makes sure that it records this commit.github-release: reads the notes from the merged PR and creates the tag and release. A re-run creates only what is missing.contents: writeandpull-requests: read, for the release job only.Not in this PR
Uploading to TestPyPI and PyPI.
publish.ymlstill does that. #784 replaces it.Setup
The GitHub App, the
RELEASE_APP_IDvariable and theRELEASE_APP_PRIVATE_KEYsecret are set on this repository already.Testing
Run end to end in a private sandbox repository, with a real merge and a hand edit of the notes in the PR. The script passes ruff and ty, and the workflow passes actionlint.