-
Notifications
You must be signed in to change notification settings - Fork 278
Publish to PyPI via GitHub CI #893
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
Conversation
ff43509 to
9ac1d79
Compare
9ac1d79 to
a3400f1
Compare
hugovk
left a comment
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.
Thanks for the PR :)
|
Looks like there was an agreement to use Also, building and running |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
From branch
Upload/download distributions between jobs using respective GitHub actions
@webknjaz Brett proposed using
Are you suggesting I add |
|
When the tag exists first, various parties would treat it as "release happened". But publishing to PyPI may fail and it would require some tag cleanup. Moreover, many release watchers will remember the old commit a being tagged / versioned. To solve this, I tend to treat successful upload to PyPI as the point of no return and only push the tag after that. |
|
As for |
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
GitHub's documentation says it's one of the steps:
Perhaps
I figure that is as error-prone as entering it at the command line when running
Ahh, I treat tags the opposite way: to me they are just a named commit, but releases must be made from existing tags. I watch for uploads to PyPI, and I'm completely fine with deleting tags. I'm generally pretty wary of writing Git changes in CI. Honestly, I think it's too limiting to uphold the expectation of "various parties would treat it as "release happened"", as tags are not releases (releases are releases!).
Right, so you're saying I should remove it (at least for CI). I disagree, as it's guaranteed to run before attempting upload to PyPI in this proposal, but it's not necessarily guaranteed in PRs (who may edit/skip CI) or locally. I also think it's unnecessary to build the package on every push to every PR, but it may be inconsequential. To reduce likelihood of |
Yes, it's the default. This is basically for choosing a workflow version from a different branch. Normally, nobody uses it and keeps it as is. But the more important part is being able to define arbitrary inputs.
Sort of. You still can build some input validation into the workflow.
That's not entirely true. GH Releases can auto-create tags — they don't need to be pre-existing. And their drafts don't even need that. The problem here is that you control the repo, but you can't influence how external observers work with it. In general, force-pushing tags is a highly discouraged practice, and they are expected to be more or less immutable. Deleting them usually either means an emergency or a supply chain attack.
Sure, but I'd be highly suspicious when I see a force-pushed tag after doing a
That's what I'm saying — |
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
cb42682 to
861784f
Compare
|
Oops accidental close (misclick - thanks GitHub for removing confirmation dialogues). Ignore that. @webknjaz @henryiii I've switched to manual workflow run (ie The manual workflow requires the commit SHA (to strongly tie it to the commit which the package is built from). |
|
@webknjaz Would you mind taking a look to review this? |
miketheman
left a comment
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.
Noticed some outdated Actions, submitted changes to latest releases
Co-authored-by: Mike Fiedler <miketheman@gmail.com>
Requested looking again over a month ago. :)
Updated the description for the 'ref' input and removed unnecessary fetch-depth comment.
| ref: | ||
| # require SHA as tags and branches are mutable | ||
| description: Git commit SHA (not branch/tag) | ||
| description: Full git commit SHA (not branch/tag) |
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.
The action will succeed with just the short SHA
Removes the package build and publish from the
releaseNox session, so now it only creates a tag and makes bump/changelog commits.Adds a package build Nox session called
release_build, which optionally checks out a tag (otherwise assumes the tag is already checked out) then builds the distributions.Adds a publish GitHub CI workflow which will be triggered on release, running
release_buildand uploading with the publish action.pypi) and add it topackagingon PyPI. Comments below suggest this environment should be configured to require approvals before running CI workflows.gitis available, but this should be verified.Did you want distribution build to be a separate CI job? That's easy enough to do, but some maintainers I've interacted with prefer the single job. It seems like theI've merged Split build out from release CI job EpicWink/packaging#1 which does this.lintCI workflow already builds and uploads the distributions.Resolves #273