Skip to content

ci: publish PyPI and npm inline from release workflows (fix #521)#592

Open
ojongerius wants to merge 1 commit into
mainfrom
worktree-fix-inline-publish
Open

ci: publish PyPI and npm inline from release workflows (fix #521)#592
ojongerius wants to merge 1 commit into
mainfrom
worktree-fix-inline-publish

Conversation

@ojongerius
Copy link
Copy Markdown
Contributor

What

Collapses the two-step release → publish pipeline for the Python and TypeScript SDKs into a single workflow each.

Why

GITHUB_TOKEN-created releases suppress downstream workflow triggers (GitHub Actions safeguard documented in #521). This meant publish-py.yml and publish-ts.yml never fired automatically — every release since the automation was introduced has silently required manual intervention to actually reach PyPI and npm.

Discovered today when sdk-py v0.10.0 and sdk-ts v0.10.0 were tagged but not published; both had to be dispatched manually.

Changes

release-sdk-py.yml

  • Add id-token: write permission (OIDC for PyPI trusted publishing)
  • Add uv build step (before creating the GitHub release)
  • Add pypa/gh-action-pypi-publish step (after creating the GitHub release)
  • Remove stale comment pointing at publish-py.yml

release-sdk-ts.yml

  • Add id-token: write permission (OIDC for npm provenance)
  • Add registry-url to actions/setup-node (required for npm auth)
  • Add dist-tag determination step (mirrors publish-ts.yml logic, using $SDK_TS_VERSION which is already verified to match package.json)
  • Add npm publish --access public --provenance step
  • Remove stale comment pointing at publish-ts.yml

publish-py.yml / publish-ts.yml

  • Remove dead release: trigger (it never fired for GITHUB_TOKEN-created releases)
  • Reduce to workflow_dispatch-only manual fallbacks with a clarifying comment
  • Tighten if: condition to github.ref == 'refs/heads/main' only

Testing

Can only be validated end-to-end on the next real release tag. The individual steps are identical to what publish-py.yml and publish-ts.yml already run successfully (used for manual recovery of v0.10.0 today).

GITHUB_TOKEN-created releases suppress downstream workflow triggers, so
publish-py.yml and publish-ts.yml never fired automatically. Collapse the
two-step pipeline: move uv build + pypi-publish into release-sdk-py.yml and
the npm dist-tag + publish steps into release-sdk-ts.yml. Both release
workflows now carry id-token: write for OIDC. publish-py.yml and
publish-ts.yml are reduced to workflow_dispatch-only manual fallbacks.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR collapses Python and TypeScript SDK publishing into their release workflows to avoid suppressed downstream release triggers from GITHUB_TOKEN-created releases.

Changes:

  • Adds OIDC publishing permissions and inline PyPI/npm publish steps to SDK release workflows.
  • Keeps publish workflows as workflow_dispatch manual fallbacks only.
  • Tightens manual fallback execution to main.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/release-sdk-ts.yml Adds npm OIDC/provenance publish inline after TypeScript SDK release creation.
.github/workflows/release-sdk-py.yml Builds Python distributions and publishes to PyPI inline after Python SDK release creation.
.github/workflows/publish-ts.yml Converts npm publish workflow to a main-only manual fallback.
.github/workflows/publish-py.yml Converts PyPI publish workflow to a main-only manual fallback.


permissions:
contents: write
id-token: write

permissions:
contents: write
id-token: write
Comment on lines +4 to 7
# Manual escape hatch — dispatch from `main` publishes whatever version
# package.json currently has. Normal releases go through release-sdk-ts.yml
# which publishes inline (see #521 for why the two-step pipeline was broken).
workflow_dispatch:
Comment on lines +4 to 7
# Manual escape hatch — dispatch from `main` publishes whatever version
# pyproject.toml currently has. Normal releases go through release-sdk-py.yml
# which publishes inline (see #521 for why the two-step pipeline was broken).
workflow_dispatch:
Comment on lines +86 to +87
- name: Publish to npm
run: npm publish --access public --provenance --tag ${{ steps.dist_tag.outputs.tag }}
Comment on lines +72 to +74
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
packages-dir: sdk/py/dist/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants