Skip to content
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

Docs: Point to a full worked usage example showing recommended usage of API token, etc? #265

Closed
dbarnett opened this issue Sep 21, 2024 · 7 comments
Labels
question Further information is requested

Comments

@dbarnett
Copy link

Could the README point to some example in the wild of someone using this properly, so I could understand how to properly configure it to publish my package?

I've pushed about 10 guess-and-check commits to my repo trying to extrapolate from the docs how to hook up API tokens and everything and just keep getting one cryptic error after another. Some of the exact parts I was missing in some of those seem to be the little placeholders like # retrieve your distributions here in the examples in docs, so it would be helpful to see how at least one project configures their action properly...

@webknjaz
Copy link
Member

@dbarnett the link to the guide in the first paragraph does show how to do it. Have you followed it?

Here's my recent state of the art release automation example, hope it helps:
https://github.com/ansible/awx-plugins/blob/e22c150/.github/workflows/ci-cd.yml#L748-L1150.

@dbarnett
Copy link
Author

That helps some. What I don't understand is how the token gets passed into hatch publish without the password: key or any reference from that job to GH secrets.

It also took me a while to figure out which other explicit steps and args were needed, but I think I got through all those questions through trial-and-error.

@webknjaz
Copy link
Member

That helps some. What I don't understand is how the token gets passed into hatch publish without the password: key or any reference from that job to GH secrets.

We call the ecosystem-standard tool called twine, it's agnostic to the way you build your dists. It's always twine upload and not related to any other tools you might use. You should download the dists you made in a separate job, in a less secure context and pass them to the action which calls twine to upload them and nothing else. It also does the OIDC auth dance to get the short-lived token and feed it to twine upload.

@webknjaz
Copy link
Member

webknjaz commented Oct 4, 2024

@dbarnett anything else you wanted to clarify, or should we close this?

@dbarnett
Copy link
Author

dbarnett commented Oct 4, 2024

Yeah, it would help to have a complete example linked from the README. Like I said, I eventually got something working through a ton of guess-and-check, but if I were starting from scratch my best hope of getting this set up properly would probably be somehow finding this issue for clarification. The examples in the README still seem way too opaque.

@adamjstewart
Copy link

https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ is probably a better worked through example, I found it much easier to understand than this project's README.

@webknjaz
Copy link
Member

Yes, that guide was created to accompany the action, which is why it is linked in the very first paragraph of the README. It is targeting an example workflow. An action is just a reusable part of a workflow, that entire document wouldn't belong here.
It doesn't seem like there's anything left to do here.

@webknjaz webknjaz added the question Further information is requested label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants