letterboxdpy icon indicating copy to clipboard operation
letterboxdpy copied to clipboard

Automate PyPI Update on GitHub Release

Open fastfingertips opened this issue 1 year ago • 5 comments

Automatically update PyPI on new GitHub releases.

fastfingertips avatar Sep 14 '24 21:09 fastfingertips

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.

nmcassa avatar Oct 24 '24 13:10 nmcassa

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.

fastfingertips avatar Oct 24 '24 17:10 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.

fastfingertips avatar Oct 24 '24 17:10 fastfingertips

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.

nmcassa avatar Oct 24 '24 19:10 nmcassa

Hey @nmcassa!

I found the solution for PyPI automation using Trusted Publishing. Could you set this up on PyPI?

PyPI Setup Steps:

  1. PyPI → Your projectsletterboxdpyManage
  2. Publishing (in sidebar)
  3. GitHub Actions tab
  4. Repository owner: nmcassa
  5. Repository name: letterboxdpy
  6. Workflow filename: pypi-publish.yml
  7. 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!

fastfingertips avatar Oct 04 '25 16:10 fastfingertips