-
Notifications
You must be signed in to change notification settings - Fork 366
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
Update release action #2172
Update release action #2172
Conversation
Replaces running on tag push, since this new way is more focused and dependent on actually making the release.
This restricts access to the PyPI token to ony the publish stage, rather than all code installed and executed during the setup and build parts. We can also restrict this to the PyPI environment.
This is better security practice than using master/main.
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.
Looks good to me. I think this is a good direction to head for releases.
- '*' | ||
release: | ||
types: | ||
- published |
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.
Do we need to add a release guide to explain what we need to do to trigger this? I assume it is "go to GitHub and publish a release" because tagging via command line and pushing a tag is not good enough here?
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.
I mean, we can stick with "tag and push" if we want, I just looked and saw we were already using the GitHub releases feature.
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.
I'm good with this, I've been making releases through the web interface.
@dopplershift, this looks good to me. Feel free to merge this when you have some time to do the other tasks you've listed as well. I don't want to merge this and be in limbo when we haven't added the other pieces necessary yet to make a release and forget to update. |
All done. This workflow worked flawlessly on the most recent MetPy release. |
A few changes to update the GitHub release workflow
The last one is a new feature just released to general availability by PyPI. Instead of using a fixed API token (which is tied to one user's account--currently mine), you configure the project on PyPI to accept publication from a particular GitHub workflow and (optionally) environment. Transparently (using the PyPA GitHub Action we're already using) GitHub and PyPI exchange the needed tokens to allow publication to PyPI. The use of an environment additionally allows some gatekeeping like wait timers, restrict certain branches for "deployment", and manual approval for "deployment", if we were so inclined.
Assuming we want to go this way, the additional items that need to take place outside the PR merger: