Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,49 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Detect the release tooling on the PR head
id: tooling
# The job builds from the reviewed head, not the merge commit, so a
# branch that predates the release tooling has no script to run.
# Skip the build with a notice instead of failing the PR; the
# ReleaseLock job above still checks the lock on the merge commit.
run: |
if [ -f .github/release_lock.py ] && [ -f .github/release_build.py ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "::notice title=Candidate wheel skipped::The PR head predates the release tooling (.github/release_lock.py and .github/release_build.py). Merge main into the branch to build its candidate wheel."
fi
- name: Set up Python
if: steps.tooling.outputs.present == 'true'
uses: actions/setup-python@v6
with:
python-version: "3.14.7"
- name: Install uv
if: steps.tooling.outputs.present == 'true'
uses: astral-sh/setup-uv@v8.1.0
with:
version: "0.12.13"
- name: Check committed registry lock
if: steps.tooling.outputs.present == 'true'
run: python .github/release_lock.py --committed
- name: Predict release version with the release helper
if: steps.tooling.outputs.present == 'true'
run: python .github/release_build.py --prepare "${{ matrix.kind }}"
- name: Refresh only the release version in the registry lock
if: steps.tooling.outputs.present == 'true'
run: python .github/release_lock.py --refresh
- name: Install package
if: steps.tooling.outputs.present == 'true'
run: uv sync --locked --extra dev
- name: Build package from unchanged policy source
if: steps.tooling.outputs.present == 'true'
run: uv run --no-sync make
- name: Record and verify release build
if: steps.tooling.outputs.present == 'true'
run: uv run --no-sync python .github/release_build.py
- name: Retain unpublished wheel and build receipt
if: steps.tooling.outputs.present == 'true'
uses: actions/upload-artifact@v4
with:
name: release-wheel-${{ matrix.kind }}-${{ github.event.pull_request.head.sha }}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/ci-candidate-wheel-skip-legacy-heads.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Skip the pull-request candidate wheel build, with a notice, when the PR head predates the release tooling, instead of failing the check on every branch opened before that tooling landed.
Loading