Automate PyPI Update on GitHub Release
Automatically update PyPI on new GitHub releases.
Hey do you know if there is a way that I can pass the PyPI ownership to you. I have been having problems updating this repo since they changed over to api tokens. I had it working for a while and now I am having difficulties again. If you make an account I can add you as a maintainer and you can follow this https://packaging.python.org/en/latest/tutorials/packaging-projects/ Though you probably already know how to do it.
Before we get started, I did a little research and found that the easiest way to implement this feature is by using GitHub Actions. I've used GitHub Actions before, but I haven't set it up for this specific purpose yet. You can try this on your own while you work on resolving the issue, and this feature can wait. Alternatively, we can begin by adding me as a maintainer, as you suggested. We can learn together through experimentation. My PyPI username is FastFingertips.
It would be great to create a test repository and learn this feature as soon as possible. I’ll work on it in my spare time.
Hey awesome, it does look like GitHub Actions is a good way to go. I added you on PyPi as well. I have been busy since I began my PhD so I am sorry if I have not been active. I appreciate all the work on this project.
Hey @nmcassa!
I found the solution for PyPI automation using Trusted Publishing. Could you set this up on PyPI?
PyPI Setup Steps:
- PyPI → Your projects →
letterboxdpy→ Manage - Publishing (in sidebar)
- GitHub Actions tab
-
Repository owner:
nmcassa -
Repository name:
letterboxdpy -
Workflow filename:
pypi-publish.yml -
Environment name:
pypi(optional but recommended)
GitHub Actions Setup: Once you set up the trusted publishing, I'll add the GitHub Actions workflow that will automatically publish to PyPI on releases.
References:
- https://docs.pypi.org/trusted-publishers/adding-a-publisher
- https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
This will solve the API token issues and make the process much more secure and automated.
Thanks!