Skip to content

move publish job to trusted publishing#1847

Merged
xavdid merged 4 commits into
masterfrom
trusted-publishing
Jul 13, 2026
Merged

move publish job to trusted publishing#1847
xavdid merged 4 commits into
masterfrom
trusted-publishing

Conversation

@xavdid

@xavdid xavdid commented Jul 13, 2026

Copy link
Copy Markdown
Member

Why?

Our current release process uses a long-lived PyPI token to upload releases. While still supported, it's no longer the favored way to do Python releases because if that token leaks, attackers can publish your package.

The current best practice is "trusted publishing", where github communicates with PyPI to mint a short-lived token with publishing permissions on demand. We start a release, get a token, use that token for the release, then revoke it.

The process is straightforward. We make these changes to our CI (using the official GH action for python publishing) and then log into PyPI and hit a checkbox to enable the feature. After that, publishing will work like it always had and we'll be able to delete the TWINE_PASSWORD secret.

What?

  • changed CI workflow to use the standard trusted publishing action
    • follows the standard practices and uses the required fields, such as environment and id-token

See Also

@xavdid
xavdid requested a review from a team as a code owner July 13, 2026 21:00
@xavdid
xavdid requested review from jar-stripe and kidus-stripe and removed request for a team and kidus-stripe July 13, 2026 21:00

@jar-stripe jar-stripe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LG!

@xavdid
xavdid merged commit 3e44405 into master Jul 13, 2026
16 checks passed
@xavdid
xavdid deleted the trusted-publishing branch July 13, 2026 21:56
xavdid added a commit that referenced this pull request Jul 17, 2026
* Update generated code (#1836)

* Update generated code for v2323 and 1f0a7866ce5b5e12153c09a04349f91486b17d95

* Update generated code for v2324 and 6012b623b1c09ad54d466947da04511a042ee45a

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

* Bump version to 15.3.0

* Reduce StripeClient() cold start latency for serverless environments (#1834)

* Remove unused Retry-After header support (#1843)

* make api error fields generated (#1845)

* move publish job to trusted publishing (#1847)

* move to trusted publishing

* Replace source hash with Telemetry UUID (#1846)

* Replace source hash with telemetry UUID

* minor tweaks

* Add/adjust tests & CI

* Bump version to 15.3.1

* use ip address directly instead of localhost for faster windows tests (#1849)

---------

Co-authored-by: stripe-openapi[bot] <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: jar-stripe <jar@stripe.com>
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.

2 participants