Skip to content
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

Deploy to PyPI using Trusted Publishing #39

Merged
merged 1 commit into from
Dec 31, 2023

Conversation

hugovk
Copy link
Collaborator

@hugovk hugovk commented Dec 31, 2023

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:

image

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.

@hugovk hugovk merged commit 0f79b2b into marcusvolz:main Dec 31, 2023
16 checks passed
@hugovk hugovk deleted the deploy-with-trusted-publishing branch December 31, 2023 12:29
@hugovk hugovk mentioned this pull request Dec 31, 2023
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.

1 participant