Skip to content

feat: PyPi trusted publishing#289

Merged
danielkov merged 20 commits intomainfrom
danielkov/feat/pypi-trusted-publishing
Feb 6, 2026
Merged

feat: PyPi trusted publishing#289
danielkov merged 20 commits intomainfrom
danielkov/feat/pypi-trusted-publishing

Conversation

@danielkov
Copy link
Copy Markdown
Contributor

@danielkov danielkov commented Feb 4, 2026

What changed?

  • Updated sdk-gen-config to latest
  • Updated assert
  • Pass PyPiTrustedPublishing config through to GHA

@danielkov danielkov requested a review from a team as a code owner February 4, 2026 21:56
danielkov and others added 19 commits February 4, 2026 21:59
GitHub Actions caches Docker images based on Dockerfile and action.yml content.
Since neither changed between v15 and v15.55.2-alpha.1, the cached image from
v15 was being used, which didn't include the PyPI trusted publishing changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github.job_workflow_sha can be empty in reusable workflows, causing
checkout to default to the main branch instead of the workflow's tag.
Extract the ref from github.workflow_ref which is more reliable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github.job_workflow_sha is empty in reusable workflows.
github.workflow_ref returns the caller's ref, not the reusable workflow's ref.

Solution: Query the GitHub API for the run's referenced_workflows array,
which contains the actual SHA of the reusable workflow.

See: actions/toolkit#1264

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add workflow outputs to sdk-publish.yaml for python_regenerated,
  python_directory, publish_python, and use_pypi_trusted_publishing
- Skip publish-pypi job when OIDC is enabled (users handle it separately)
- Remove OIDC-specific steps from token-based publish-pypi job
- Create publish-pypi composite action for OIDC trusted publishing

Users who want OIDC trusted publishing can now add a separate job in their
workflow that calls the composite action, which runs in their workflow's
OIDC context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The pypa/gh-action-pypi-publish Docker action incorrectly resolves the
GITHUB_ACTION_REPOSITORY and GITHUB_ACTION_REF context variables when
used within composite actions, causing it to try to run the wrong Docker
image (speakeasy-api/sdk-generation-action instead of pypa's own image).

Using uv publish --trusted-publishing always avoids this issue entirely
since it runs directly in the shell context without Docker.

Also added ref parameter to checkout step to ensure the correct tag
version is checked out instead of main.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@danielkov danielkov merged commit bfe04d2 into main Feb 6, 2026
3 checks passed
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