larray-project / larray

N-dimensional labelled arrays in Python
https://larray.readthedocs.io/
GNU General Public License v3.0
8 stars 6 forks source link

Publish to PyPI via github action/trusted publisher #1113

Open gdementen opened 3 months ago

gdementen commented 3 months ago

I tried to set this up for the 0.34.3 release, but I was a bit in a hurry and did not finish it. I still commited it hoping that it would work but the partial 0.34.4 release proved that it does not: the "build things" part seems to work (https://github.com/larray-project/larray/actions/runs/10060877031/job/27809523590), but not the "upload to (Test)PyPI" part (https://github.com/larray-project/larray/actions/runs/10060877031/job/27809545611). I suspect it is because I configured the trusted publisher on PyPI to use a specific "release" Environment (because this was recommended) and did not configure anything specific on the GitHub side. To be honest, I don't know what an Environment means in this context, I will have to look that up.

References: https://docs.pypi.org/trusted-publishers/troubleshooting/

FWIW, for the 0.34.3 release, I used a personal token for my PyPI account instead because the old login/password method is not supported anymore. The token method is not recommended but at least it was easier to setup.