-
Notifications
You must be signed in to change notification settings - Fork 25
ci: Migrate release workflow to Trusted Publishing #517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
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
Uh oh!
There was an error while loading. Please reload this page.
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.