fix: pypi publish pipeline and workflows#18
Merged
Conversation
commit: |
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.
Summary
Fixes the release pipeline so the PyPI publish actually fires after the automated release PR is merged, runs Python checks before any tag is created, and produces a clean release PR with a single changelog section per version.
Changes
Release flow
release.ymlnow runs TypeScript and Python checks in parallel beforechangesets/actionruns. Tag creation and npm publish only happen if both pass./in@cloudflare/flagship-python@*).publish-pypi.ymlis now a reusable workflow called directly fromrelease.yml, gated onsteps.changesets.outputs.published == 'true'— so PyPI only publishes on actual releases, not every merge tomain.publish-pypi.ymlno longer re-runs Python checks (already validated inrelease.yml).Single canonical release package
changeset-version.tsnow rewrites every SDK changeset to target@cloudflare/flagship, so the release PR body and changelog only show one section per version.@cloudflare/flagship-python) are still synced to match, but they no longer appear as separate release entries.privatePackages.tagset tofalse— only one git tag per release (@cloudflare/flagship@x.y.z).sdks/python/CHANGELOG.mdis deleted automatically afterpnpm changeset version.Native lockfile sync
changeset-version.tsnow runsuv lockafter bumpingsdks/python/pyproject.toml, so the release PR includes an up-to-dateuv.lock. Without this,uv sync --lockedin CI would fail when processing the release PR.setup-uvadded to the publish job inrelease.ymlsouv lockis available during the version step.Workflow consistency cleanup
astral-sh/setup-uvreferences pinned to SHA acrossrelease.yml,publish-pypi.yml, andpull-request.yml.uv sync --group dev --lockedonce, then invoke tools directly — no more per-tool auto-sync.needs: typescript-buildandneeds: python-builddependencies from typecheck/test jobs inpull-request.yml. Those jobs were sequentially gated on a build whose artifacts they never consumed.permissionsblock on the reusable-workflow caller (reusable workflows define their own).Release flow after this PR
release.ymlruns checks →changesets/actioncreates/updates the release PR.release.ymlruns checks again →changesets/actionpublishes@cloudflare/flagshipto npm and creates the tag →publish-pypi.ymlis invoked → PyPI publishes via OIDC trusted publishing.Regular merges to
main(no changesets) run the checks but skip publish entirely.