Pipx: Automated PyPI release using Github Actions on Github release

Created on 18 Oct 2020  ·  10Comments  ·  Source: pipxproject/pipx

How would this feature be useful?

Proposing a one-stop release process that is script-based using Github Actions. This would ensure consistency, make releases easier, and prevent user release errors.

Describe the solution you'd like

The trigger would be a Github release, which would then instigate a PyPI release.

Using this as base instructions, to be modified for our use case:
https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

@cs01, one thing we would need to automate PyPI release is a new Github Secret for repository pipx, which would be a PyPI API token. Currently I don't have access to the Secrets settings for repo pipx, either you'd need to make a secret or make that repo setting available to pipx-maintainers.

Describe alternatives you've considered

Otherwise, manual like usual.

Most helpful comment

I don't really see any advantage from on release. It means you can only release from the Github UI and not via the command-line tool, not? While using on tag allows you to do it both from the web-ui and the command line.

All 10 comments

I agree. I do this for my other maintained projects and works great https://github.com/pypa/virtualenv/blob/main/.github/workflows/check.yml#L130😎👏

Thanks for the example.

I agree. I do this for my other maintained projects and works great https://github.com/pypa/virtualenv/blob/main/.github/workflows/check.yml#L130sunglassesclap

How do you generally add these tags? By using "Draft a new release" in the UI, or by git push'ing a tag, or something else?

The core trigger is the git tag presence. This can be achieved via both git push and draft a new release on the UI.

Is the advantage over using the "on release" trigger for Github Actions, that you can simply just tag it to get the same effect as using the web UI? Or are there other advantages to not using "on release"?

I don't really see any advantage from on release. It means you can only release from the Github UI and not via the command-line tool, not? While using on tag allows you to do it both from the web-ui and the command line.

I noticed if a release is done via the web UI it has a “verified” attribute.

I've been trying out the github CLI and I find it very convenient. I bet you could trigger "on release" from the command-line using it (but I'm not positive.) It is nice with your approach that all you need to do is git tag and it counts as a release.

I noticed if a release is done via the web UI, it has a “verified” attribute.

You can always go to the release for what it's worth, edit it and press publish on the web UI later and will be still verified.

You can look at the template https://github.com/cjolowicz/cookiecutter-hypermodern-python there is a good workflow for automatically publish on PyPI or PyPI test. And there is an integration of release-drafter too. I used it for projects I maintain.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cs01 picture cs01  ·  4Comments

guykisel picture guykisel  ·  4Comments

floatingpurr picture floatingpurr  ·  5Comments

rugk picture rugk  ·  4Comments

DG-SHeather picture DG-SHeather  ·  5Comments