ci: Migrate release workflow to Trusted Publishing#517
Merged
gjtorikian merged 5 commits intomainfrom Jan 21, 2026
Merged
Conversation
Contributor
Greptile SummaryThis PR successfully migrates the PyPI release workflow from API token authentication to OpenID Connect (OIDC) Trusted Publishing, significantly improving security by eliminating the need for long-lived API tokens. The workflow now operates in three isolated stages: build, comprehensive smoke testing across all supported Python versions (3.8-3.14), and publishing to PyPI. Key improvements:
The smoke test suite is thorough, covering package imports, version metadata, type markers ( Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub (Release Event)
participant Build as Build Job
participant Artifacts as GitHub Artifacts
participant Smoke as Smoke Test Job (Matrix 3.8-3.14)
participant Publish as Publish Job
participant PyPI as PyPI (OIDC)
GH->>Build: Trigger on release published
Build->>Build: Checkout code
Build->>Build: Install uv
Build->>Build: uv build (wheel + sdist)
Build->>Artifacts: Upload dist/ artifacts
Artifacts->>Smoke: Download dist/ artifacts
Note over Smoke: Runs in parallel for each Python version
Smoke->>Smoke: Install uv
Smoke->>Smoke: Test wheel: uv run --isolated --with dist/*.whl
Smoke->>Smoke: Test sdist: uv run --isolated --with dist/*.tar.gz
Smoke->>Smoke: Verify imports, types, clients, modules
alt All smoke tests pass
Artifacts->>Publish: Download dist/ artifacts
Publish->>Publish: Install uv
Publish->>PyPI: uv publish (Trusted Publishing OIDC)
PyPI-->>Publish: Package published
else Any smoke test fails
Smoke-->>GH: Workflow fails, no publish
end
|
dc2081a to
5cf8f99
Compare
- Replace Twine/token-based auth with PyPI Trusted Publishing - Add smoke tests to verify wheel and sdist before publishing - Run smoke tests against all supported Python versions (3.8-3.14) - Use matrix strategy for parallel testing across versions - Use uv publish for streamlined publishing Workflow structure: 1. build: Create wheel and sdist artifacts 2. smoke-test: Test on Python 3.8-3.14 in parallel 3. publish: Upload to PyPI after all tests pass Smoke tests verify: - Package imports correctly - Both sync/async clients instantiate - All module properties accessible - Core types and exceptions importable - Dependencies properly bundled - py.typed marker present
Pass python-version to setup-uv action to ensure the correct Python version is installed before running smoke tests. Enable cache-python to speed up subsequent workflow runs.
ad39cd0 to
aaf2930
Compare
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.
Description
This PR migrates our PyPI release publishing from API token authentication to Trusted Publishing (OIDC) for improved security.
Additionally, while working on the PR I reviewed the
uvexample workflow and came to the realization that our previous release strategy merely duplicated the testing strategy from our CI tests (i.e. usingpytestin a virtual environment) and not whether or not the package would be importable by clients and that all modules were accessible.The release workflow now operates in isolated stages:
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.