-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add GitHub action for publishing artifacts to PyPI #5244
Conversation
Excellent! Thanks a lot @andersy005 . We could change the "how to release" steps too, in another PR is fine (or I can do it). |
+1 for updating the how to release doc in another PR... I should point out that there are steps that this action doesn't address. For instance, step 2 and step 16
How should we address these steps as part of the semi-automated release? Ccing @pydata/xarray in case they want to chime in |
I think both of those should be script-able as actions:
This could run on each commit to stable, opening a PR to master if required, I think
This could run on each tag, like the push to PyPI. There's one action of "update the release tag in RTD" which may still be manual (though no need to do them now, I generally have tried to make the process 25% easier each release, I think these incremental PRs are ideal) |
👍🏽 for addressing these in separate PRs |
@andersy005 I'm curious, why do you go with multiple jobs within the workflow, and using artifacts to transfer state between them, rather than multiple steps in a single job? |
I have a tendency to split a workflow into multiple jobs because it makes reasoning about the workflow easy (at least for me :)) . However, I think using a single job here would reduce overhead since the logic isn't complex to warrant a need for multiple jobs... |
if it's possible, it might still make sense to create and test the wheels for uploaded |
@andersy005 are you OK to try and merge this "as is" sometime today and then help us making a couple of tests on (worst case: we release the old way) |
from #5232:
@andersy005, what do you think? This should be pretty easy if we have separate jobs for building / testing / uploads (where the upload to |
I've doing this for a while now in one of my projects. Not sure if it will be used much, but users could easily install versions from |
.github/workflows/pypi-release.yaml
Outdated
- name: Publish package to TestPyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TESTPYPI_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
verbose: true |
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.
This will be triggered on every push event on the master branch and release tag... Should we constrain this to be triggered on push events on the master branch only?
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 think we should include tags but not releases (which are generated via the web page). That way, we can check the wheels on TestPyPI before creating the release and uploading to PyPI.
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.
This should be resolved by the latest commit...
I grabbed the |
Any consensus on whether this is ready to merge? We should start the release process shortly (once the US wakes up). |
I'd say let's resolve #5244 (comment) and #5244 (comment) first |
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.
great, looks good. I'd say let's merge and check whether the packages are uploaded correctly to TestPyPI (PYPI_TOKEN
will have to be set by either @max-sixty, @dcherian, @jhamman, or @shoyer).
Edit: @andersy005, feel free to merge once you think it is ready
on: | ||
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.
I usually use created
here, but this probably doesn't make much of a difference since we don't use "draft releases" (and I can't seem to find a page which explains the difference between the "activity types")
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.
Not sure if you've seen this page already. There's this note:
Note: The prereleased type will not trigger for pre-releases published from draft releases, but the published type will trigger. If you want a workflow to run when stable and pre-releases publish, subscribe to published instead of released and prereleased.
it seems PyPI does not allow packages with versions like |
This addresses #5232 (comment), and will (hopefully) reduce the time it takes to cut a new release.
pre-commit run --all-files