-
Notifications
You must be signed in to change notification settings - Fork 49
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
Use trusted publishing with both PyPI and TestPyPI #129
Conversation
For both the action step documentation and Python Packaging User Guide says that repository-url is required for publishing on TestPyPI, but the workflow run produces this warning: > Unexpected input(s) 'repository-url', valid inputs are > ['entryPoint', 'args', 'user', 'password', 'repository_url', > 'packages_dir', 'verify_metadata', 'skip_existing', 'verbose', > 'print_hash'] And this warning: > Warning: It looks like you are trying to use an API token to > authenticate in the package index and your token value does not > start with "pypi-" as it typically should. This may cause an > authentication error. Please verify that you have copied your token > properly if such an error occurs. And this error message: > INFO Response from https://upload.pypi.org/legacy/: > 403 Invalid or non-existent authentication information. See > https://pypi.org/help/#invalid-auth for more information. > INFO <html> > <head> > <title>403 Invalid or non-existent authentication information. See > https://pypi.org/help/#invalid-auth for more information.</title> > </head> > <body> > <h1>403 Invalid or non-existent authentication information. See > https://pypi.org/help/#invalid-auth for more information.</h1> > Access was denied to this resource.<br/><br/> > Invalid or non-existent authentication information. See > https://pypi.org/help/#invalid-auth for more information. > > > </body> > </html> > ERROR HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/ > Invalid or non-existent authentication information. See > https://pypi.org/help/#invalid-auth for more information. Let us give repository_url a try then!
Stay with the known devil
After updating pypa/gh-action-pypi-publish, the warning about repository url changed: > Warning: Input 'repository_url' has been deprecated with message: > The inputs have been normalized to use kebab-case. Use > `repository-url` instead.
Done with debugging the trusted publishing workflow, I hope.
This is ready for review. These are the changes:
I have tested the workflow with both PyPI and TestPyPI, and things seem to work just fine. See the yanked release at PyPI (https://pypi.org/manage/project/zfec/release/1.6.0.1.post0/) and the recent uploads to TestPyPI (https://test.pypi.org/project/zfec/#history). |
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.
Wow, this was much more work than I thought. Thanks for doing it! The GHA config is easy to follow. I like that you kept close to the documented examples. Looking very good to me!
Attempting to resolve #127; stacked on top of #121. I have added the repository owner (tahoe-lafs), repository name (zfec), workflow file (build.yml), and environment (release or testpypi) to add GHA as a publisher both on TestPyPI and PyPI.