ci(publish): build + publish in one job (fix BlobNotFound artifact handoff) - #1709
Merged
Conversation
…andoff The two-job split passed the wheel from the build job to the publish job via upload/download-artifact, which failed repeatedly with BlobNotFound on the same-run download (GitHub artifact-service flake) — the PyPI upload step never ran. Collapse into a single `publish` job that builds and publishes in the same workspace, removing the handoff entirely. The job keeps the `pypi` environment gate, OIDC (id-token: write), refs/tags checkout, and the on-main + version-manifest checks.
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the PyPI publish workflow to avoid cross-job artifact handoff failures (BlobNotFound) by performing build and publish steps within a single job, keeping the release process self-contained while still enforcing the existing tag validation and pypi environment approval gate.
Changes:
- Collapse the prior
build→publishtwo-job workflow into a singlepublishjob. - Remove
upload-artifact/download-artifactusage sopypa/gh-action-pypi-publishreads directly from the locally builtdist/. - Keep existing safeguards: validated
refs/tags/...checkout, “tag is on main” ancestry check, andtag == mempalace/version.pycheck.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Why
The v3.3.6 publish runs failed twice, both at the publish job's
download-artifactstep withBlobNotFound. The build job builtmempalace-3.3.6.tar.gz+.whland uploaded a valid 25 MBdistartifact (confirmed in the run's artifact list), but the cross-job download consistently failed — a GitHub v4 artifact-service flake. The PyPI upload step never ran, so nothing was published.What
Collapse the two-job (build → publish) split into a single
publishjob that builds and publishes in the same workspace, so there's no upload/download-artifact handoff to fail.pypa/gh-action-pypi-publishreads straight fromdist/.Unchanged:
pypienvironment approval gate, OIDCid-token: write, theworkflow_dispatchmanual trigger + validatedrefs/tags/checkout, and the on-main+tag == version.pychecks. The PyPI trusted-publisher config keys on workflow filename + environment, not job structure, so it still matches.Trade-off: the build now runs behind the approval gate (you approve, then it builds + publishes) instead of before it. The post-publish validation (
pip install+ build a palace) is unchanged.Self-review (done before pushing)
environment: pypi+permissions: {contents: read, id-token: write}.${{ }}in anyrun:(inputs viaenv:, quoted"$TAG"); checkoutref: refs/tags/<validated-tag>.vMAJOR.MINOR.PATCH[-suffix](rejectsv3,main, injection).