Skip to content

chore: Add trusted publishing workflow - #490

Merged
camdecoster merged 5 commits into
mainfrom
cam/489/switch-trusted-publishing
Nov 18, 2026
Merged

camdecoster merged 5 commits into
mainfrom
cam/489/switch-trusted-publishing

Conversation

@camdecoster

@camdecoster camdecoster commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add trusted publishing workflow for PyPI.

Closes #489.

Changes

  • Add workflow
  • Update testing workflow to remove publishing to TestPyPI
  • Pin actions
  • Update release docs

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

@camdecoster

Copy link
Copy Markdown
Contributor Author

I added the trusted publisher in PyPI and the pypi env in this repo.

Comment thread RELEASE.md Outdated
- 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It handles each case, so it seems okay to leave as is. I don't feel strongly about it though.

@KoolADE85 KoolADE85 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice automation cam!!

@camdecoster
camdecoster merged commit 51044e3 into main Nov 18, 2026
2 of 4 checks passed
@camdecoster
camdecoster deleted the cam/489/switch-trusted-publishing branch November 18, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE]: Add trusted publishing workflows

2 participants