ci: only run Python Release Build on RC tags and matching PRs#1754
Merged
andygrove merged 2 commits intoMay 23, 2026
Conversation
The previous `on:` block ran the wheel pipeline on every push to a release branch (`branches: ["branch-*"]`) and used a single `paths:` filter that, by being scoped to the whole `push:` block, also gated tag pushes on a python/** path change. Neither is desirable: - Pushes to `branch-*` (commits, cherry-picks, changelog updates) don't need to rebuild release wheels. The RC tag push is the canonical event that produces release artifacts. - RC tag pushes should always rebuild, regardless of which paths the RC commit happens to touch. Today's `53.0.0-rc1` push only modified `CHANGELOG.md` and triggered the workflow only because of how GitHub's `paths` filter handles tag pushes (comparing against the previous tag, which happened to include python/** changes). Relying on that is fragile. Drop both `branches:` and `paths:` from the `push:` block, leaving just `tags: ["*-rc*"]`. The `pull_request: paths:` filter is unchanged. The set of events that fire the workflow is now: - pull_request that changes any python/** file - push of any tag matching `*-rc*`
The previous assertion ran `ls -A target/wheels` from the default workdir (the repo root). Because each \`run:\` step starts with cwd reset to the workspace root, the \`cd python\` from the previous step did not carry over and \`target/wheels\` resolved to \`<repo>/target/wheels\`, which doesn't exist. \`ls -A\` returned empty and the assertion always printed \"Directory is clean\" regardless of what maturin actually produced. Switch to checking both \`python/dist/\` (where \`--out dist\` lands maturin output today) and \`python/target/wheels/\` (the older default, in case maturin behavior or flags change) for \`*.whl\` files via \`find\`, so the assertion now actually fails when sdist accidentally produces wheels.
andygrove
added a commit
that referenced
this pull request
May 23, 2026
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.
Which issue does this PR close?
Closes #.
Rationale for this change
Two small fixes to the Python Release Build workflow.
1. Triggers. The current
on:block has two problems. It runs the wheel pipeline on every push to a release branch (push: branches: ["branch-*"]) — heavy, and a release-branch push isn't the canonical event for cutting artifacts; the RC tag is. It also gates tag pushes on apaths: ["python/**"]filter scoped to the wholepush:block, so an RC tag push only triggers if the tagged commit changedpython/**.53.0.0-rc1happened to trigger only because GitHub'spathsfilter on tag pushes compares against the previous tag (which had python/** changes since the prior release). Relying on that is fragile.2. Sdist assertion was always vacuous.
build-sdist's assertion step ranls -A target/wheelsfrom the default workdir. Because eachrun:step starts with cwd reset to the workspace root, thecd pythonfrom the previous step did not carry over andtarget/wheelsresolved to<repo>/target/wheels, which doesn't exist.ls -Areturned empty and the assertion always printed "Directory is clean" regardless of what maturin actually produced.What changes are included in this PR?
.github/workflows/build.yml:branches:andpaths:from thepush:block, leaving onlytags: ["*-rc*"]. The pull-request trigger is unchanged.cd pythonandfind dist target/wheels -name '*.whl', covering both the current--out distlocation and the older defaulttarget/wheels/.Resulting trigger semantics:
python/**python/***-rc*tagbranch-*mainAre there any user-facing changes?
No code changes. CI-only. Release managers should be aware: cutting an RC is now the sole trigger for producing release artifacts on the apache repo, and it always rebuilds regardless of what the RC commit touched.