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

Do not use tokens for Pypi uploads #248

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

cphyc
Copy link
Member

@cphyc cphyc commented Mar 18, 2024

This replaces the need to use a token to upload to Pypi. Instead, one configures the project on Pypi to accept authentication from GitHub (https://pypi.org/manage/project/yt-astro-analysis/settings/publishing/).

This should allow us to completely remove the need for authorization tokens in the secrets.

@@ -63,6 +63,11 @@ jobs:
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'yt_astro_analysis-'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/yt_astro_analysis-')
environment:
name: pypi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the email I got when trusted-publishing was enabled on PyPI:

Environment: upload_pypi

The same name should be used here (but you could also change it on PyPI if you haven't already)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that you'll also need to actually create the env on the repo's side

@brittonsmith
Copy link
Member

Looks good to me, to the extent that I know much about this. Do you want to try and test it out on test.pypi?

Copy link
Member

@brittonsmith brittonsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cphyc approval from me, but I think you should merge it in case you want to see what happens when you do.

@cphyc cphyc merged commit f1cb2c7 into yt-project:main Apr 3, 2024
13 checks passed
@cphyc cphyc deleted the upgrade-pypi-credentials branch April 3, 2024 12:19
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.

3 participants