Deploy to PyPI using Trusted Publishing #39
Merged
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.
Trusted Publishing is a way to use short-lived tokens to automatically upload to PyPI:
https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
It is more secure: the release is made from a clean CI run rather than the maintainer's own computer (we're using this method). Also the tokens are short-lived and don't rely on storing long-lived API tokens on your computer or in the repo.
It's automated, and more reproducible, and makes it easier to release.
This workflow shows a preview of what would be released for every run. For merges to
main
, it deploys to TestPyPI, and when creating a "GitHub release" it deploys to production PyPI.I've set up both TestPyPI and PyPI for this, it looks like this:
Here's a preview:
https://github.com/marcusvolz/strava_py/actions/runs/7370157427?pr=39
I'll update
RELEASING.md
after doing a new release to support 3.12.