Set up trusted publishing to PyPI#345
Conversation
There was a problem hiding this comment.
Thanks for pushing this forward! A few points:
- Relative links in the README at https://test.pypi.org/project/reccmp/ do not work. Not sure what the best course of action is - maybe a separate, shorter README for PyPI with a link to the full GitHub README?
At the moment, you are the only person with access to the PyPI project, correct? Not sure if we want to change that (bus factor etc.). I haven't looked into this, but can you give other people access to the PyPI project without having to share your account credentials?Edit: AddressedI think we should also set up dependabot. I'll look into it-> #346 Edit: AddressedHave you tested this flow somewhere? I couldn't find any runs.Edit: Addressed
I'll take another look once you've addressed these points. Feel free to request another review.
| name: Publish | ||
|
|
||
| on: | ||
| push: |
There was a problem hiding this comment.
General question: What is the workflow you intended here? Manually create a GitHub release and have the CI run on the tag being pushed? (Edit: I saw that you intend to create a release in this flow, so that's probably not what you had in mind). In that case, I'd set up a trigger like
on:
release:
types: [created]
Furthermore: If we stay on the push trigger, should we also restrict this to commits to the master branch that have a version tag? I don't think we should release from any branch other than master since they don't have branch protection.
Also, maybe we should create a PUBLISHING.md just to write down the workflow / procedure as a reference?
There was a problem hiding this comment.
In its current state:
- Push the tag upstream.
- Approve the build/publish step to run.
And the release is created from the tag. I wanted the build artifacts added to the release automatically so there's less potential for user error with a manual download/upload step. If there's a better way that begins with creating (draft) releases then that's probably better.
I tried adding branch: [master] to the YML but that ended up running the build action for any push to master, not the intended combination of v* tag and master push. If it's possible to add multiple conditions then we should have them.
There was a problem hiding this comment.
Fair enough. If you add a 3-sentence PUBLISHING.md, I'll consider this point to be resolved.
|
A separate PR sounds nice. I'd prefer to leave the current README as-is since it fits the "GitHub project README" spirit quite well in my opinion. A second README for PyPI only would be preferable to me. Moving other markdown files to |
Preview: https://test.pypi.org/project/reccmp/
I was experimenting with calver. We will user semver instead.