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

CI: Allow PyPI publishing to be done manually #31

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

pniedzielski
Copy link
Collaborator

We have occassionally gotten transient GitHub Action failures that seem to be due to GitHub’s infrastructure, rather than our own workflows. In the case of creating a new GitHub release, this may result in a failure to upload the build wheels to PyPI. For that reason, it is useful to be able to dispatch a PyPI upload manually, without creating a new GitHub release. This patch enables the workflow_dispatch trigger for our wheels, and explicitly allows upload_pypi to run on workflow_dispatch, which allows us to manually and intentionally call this workflow without making a new release.

We want this to be run intentionally, though, so it’s important to note that to trigger a workflow_dispatch event, the workflow has to be on main. This means we cannot publish from a branch or PR that has not yet been merged. Because the primary use case of this is to try publishing a PyPI upload again after a transient failure due to GitHub’s infrastructure, this restriction is useful.

This patch was originally part of PR #30, but separating it out for its own review is important. Adding this infrastructure will give us a hook to update our GitHub docs without making a new release.

We have occassionally gotten transient GitHub Action failures that seem
to be due to GitHub’s infrastructure, rather than our own workflows.  In
the case of creating a new GitHub release, this may result in a failure
to upload the build wheels to PyPI.  For that reason, it is useful to be
able to dispatch a PyPI upload manually, without creating a new GitHub
release.  This patch enables the `workflow_dispatch` trigger for our
`wheels`, and explicitly allows `upload_pypi` to run on
`workflow_dispatch`, which allows us to manually and intentionally call
this workflow without making a new release.

We want this to be run intentionally, though, so it’s important to note
that to trigger a `workflow_dispatch` event, the workflow has to be on
`main`.  This means we cannot publish from a branch or PR that has not
yet been merged.  Because the primary use case of this is to try
publishing a PyPI upload again after a transient failure due to GitHub’s
infrastructure, this restriction is useful.

Signed-off-by: Patrick M. Niedzielski <[email protected]>
@pniedzielski pniedzielski added the enhancement New feature or request label Feb 14, 2024
@pniedzielski pniedzielski requested a review from hallfox February 14, 2024 20:05
@pniedzielski pniedzielski requested a review from a team as a code owner February 14, 2024 20:05
@pniedzielski pniedzielski merged commit 36b07bc into bloomberg:main Feb 22, 2024
11 checks passed
@pniedzielski pniedzielski deleted the manual-pypi branch March 12, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants