Add lockstep release workflow to main (dispatch-only) - #685
Draft
umair-ably wants to merge 1 commit into
Draft
Conversation
Brings `.github/workflows/release.yml` and `scripts/release_preflight.py` from #684 (`pubsub-split/release-tooling`) onto `main`, and nothing else. GitHub only registers a `workflow_dispatch` workflow once its file exists on the default branch. The PubSub split work merges to `integration/v4` and will not reach `main` until GA, so without this the lockstep release workflow cannot be dispatched at all — including the run that claims the `ably-pubsub-core` / `ably-pubsub-server` names on PyPI through trusted publishing (plan steps 1 and 16) and the prerelease runs cut from split branches. With the file here, `gh workflow run release.yml --ref <branch> -f version=...` works against any ref that carries the split layout. The workflow is inert on `main`: dispatched here, the pre-flight refuses the single-distribution layout before anything is built or uploaded, and publishing would in any case need trusted publishers bound to the two new project names, which do not exist yet. To make that refusal legible rather than a FileNotFoundError, the pre-flight grows a `require_split_layout()` guard that aborts with an explanation when `core/pyproject.toml` / `server/pyproject.toml` are absent, and `release.yml` runs the (build-free) version-site pre-flight right after `uv sync`, before the build, so the guard fires first. Both are no-ops on the split layout; #684 should pick up the same two changes so the copies stay identical. Mirrors ably-ruby#455. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
umair-ably
added a commit
that referenced
this pull request
Sep 3, 2026
…ge layout This workflow file and the pre-flight script also live on `main`, because workflow_dispatch only offers workflows present on the default branch. `main` still has the flat `ably/` package, so a dispatch there would die on a FileNotFoundError from the first version site the script reads. require_split_layout() checks for the two member pyprojects up front and exits with an explanation pointing at the refs that do have the split layout, and the workflow calls the script once before the build so that failure lands in a step named for it. Mirrors #685 so the two copies of both files stay byte-identical. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
What
Brings exactly two files from #684 (
pubsub-split/release-tooling) ontomain:.github/workflows/release.yml— the lockstepably-pubsub-core+ably-pubsub-serverrelease workflowscripts/release_preflight.py— the pre-flight it (andcheck.yml's dry-run job) callsNothing else from #684 comes with it: no
CONTRIBUTING.md, no/releaseskill, nopyproject.toml/LICENSEchanges, nouv.lockchange.Why
GitHub only registers a
workflow_dispatchworkflow once its file exists on the default branch. The PubSub split work merges tointegration/v4and will not reachmainuntil GA, so without this the lockstep release workflow cannot be dispatched at all. This is plan step 15b, and it mirrors the sibling ably-ruby#455 ("Add lockstep release workflow to main (dispatch-only)").Merging this replaces
main's tag-triggered, single-distribution publish workflow.Tag-triggered runs execute the workflow file as it exists at the tagged commit, so releases of the legacy
ably3.x package are unaffected — but only as long as they are tagged from a maintenance branch, not frommain. After this merges, av3.x.ytag cut frommainwould run the two-distribution workflow and fail the pre-flight instead of publishingably.Therefore, as a merge precondition:
maintenance/3.x(name TBC org-wide — plan step 24) must be cut frommainbefore this PR merges. It keeps today's unchanged single-distributionrelease.yml.v3.*tags go to that branch only.Please do not merge until (1) is done.
What this enables
Once on
main, the workflow is dispatchable against any ref that carries the split layout:Used for:
ably-pubsub-core/ably-pubsub-servervia pending trusted publishers, immediately after the repo rename (plan steps 1 and 16);Inert on
mainmain, the pre-flight refuses the single-distribution layout before anything is built or uploaded.release.ymlfor the two new project names, which do not exist yet.To make that refusal legible rather than a
FileNotFoundErrortraceback, two small changes were made (both no-ops on the split layout, and #684 should pick up the same two so the copies do not diverge):scripts/release_preflight.pygains arequire_split_layout()guard, called first inmain().release.ymlruns the build-free version-site pre-flight right afteruv sync, beforeuv build --package ably-pubsub-core— which onmainwould otherwise be the first thing to fail, with an unhelpful "package not found in workspace" error.Verification
yaml.safe_loadon the workflow: OK.actionlint .github/workflows/release.yml: clean.ruff check scripts/release_preflight.py: clean.main's layout exits 1 with:🤖 Generated with Claude Code