Workflow for publishing to TestPyPI#48
Workflow for publishing to TestPyPI#48kevinbackhouse merged 2 commits intoGitHubSecurityLab:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a reusable workflow pattern for publishing Python packages to PyPI/TestPyPI. It adds two new workflow files: a reusable workflow that handles the entire publish process (building, signing, uploading to PyPI, and creating GitHub releases), and a caller workflow configured for TestPyPI.
- Adds a reusable workflow (
publish-reusable.yml) that builds Python packages, publishes to PyPI/TestPyPI, signs with sigstore, and creates GitHub releases - Adds a caller workflow (
publish-to-testpypi.yaml) that triggers the reusable workflow for TestPyPI deployments - Implements trusted publishing with OIDC for secure PyPI authentication
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/publish-to-testpypi.yaml |
Caller workflow that invokes the reusable workflow for TestPyPI publishing with manual trigger |
.github/workflows/publish-reusable.yml |
Reusable workflow that handles building, publishing, signing, and release creation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
336ee26 to
3bcd8aa
Compare
3bcd8aa to
5d5e977
Compare
| uses: .github/workflows/publish-reusable.yml@main | ||
| with: | ||
| version: ${{ inputs.version }} | ||
| release_notes: ${{ github.head_ref }} |
There was a problem hiding this comment.
Yes, because this whole workflow is just for testing. It pushes to TestPyPI, so my intention is that we can do it whenever we feel like it, rather than just when we have a new release.
I'm planning to add a separate workflow for pushing to PyPI, which is why I've put most of the logic in a reusable workflow.
https://test.pypi.org/ is a testing version of https://pypi.org. I'll try to get this workflow working there first before I try to add the real PyPI. I've implemented it with a reusable workflow, so hopefully it will be easy to add PyPI when I've got this working.