Repository navigation
chore: Add trusted publishing workflow - #490
Conversation
|
I added the trusted publisher in PyPI and the pypi env in this repo. |
| - Open the run and approve the deployment under "Review deployments" | ||
| - The `pypi` environment needs a review from the `plotly/libraries_admin` team. The job waits for that approval before GitHub issues the OIDC token, so an unapproved run never reaches PyPI. | ||
| - The workflow checks out the tag, builds the package, and confirms that the built version matches the tag. The upload uses `skip-existing`, so a second run of the same tag skips the files that PyPI holds already. | ||
| 7. Release on GitHub: |
There was a problem hiding this comment.
Since this now builds and publishes its own .whl files, could we also have it draft the Github release and auto-attach its own artifacts for us?
It would be nice to fully publish the GH release, but I can understand it would be a bit error-prone to auto-paste the correct part of the changelog.
There was a problem hiding this comment.
Let's give it a shot!
| - run: uv sync --locked --all-extras --no-sources | ||
| - run: git diff --quiet HEAD || { echo "Working tree dirty"; exit 1; } | ||
| - run: uv build | ||
| - name: Verify that the build matches the tag |
There was a problem hiding this comment.
nit: the workflow accepts a tag with or without the leading v.
I don't think there's a technical problem with that, but maybe for consistency, we should enforce the leading v?
There was a problem hiding this comment.
It handles each case, so it seems okay to leave as is. I don't feel strongly about it though.
Description
Add trusted publishing workflow for PyPI.
Closes #489.
Changes
Testing
This can't be tested until after it merges. At that point, we can run a workflow dispatch with an existing version (v1.5.1) and ensure it gets skipped.
Notes