Skip to content

Add trusted publishing options to generate-ci#3176

Merged
messense merged 2 commits intoPyO3:mainfrom
messense:feat/generate-ci-trusted-publishing
May 7, 2026
Merged

Add trusted publishing options to generate-ci#3176
messense merged 2 commits intoPyO3:mainfrom
messense:feat/generate-ci-trusted-publishing

Conversation

@messense
Copy link
Copy Markdown
Member

@messense messense commented May 7, 2026

Closes #3166.

messense added 2 commits May 7, 2026 19:45
Add a note that `Changelog.md` is generated from git history by
`git-cliff` (see `cliff.toml`) and should not be edited by hand,
to prevent agents and contributors from accidentally maintaining it
manually.
Add two new fields to `[tool.maturin.generate-ci.github]`:

- `trusted-publishing` (bool): when `true`, the generated release
  workflow runs `uv publish --trusted-publishing always` and omits
  the `UV_PUBLISH_TOKEN` env var. This makes the workflow rely on
  PyPI's [trusted publishing][1] (OpenID Connect) instead of an API
  token, removing the need to manage a long-lived secret.
- `publishing-environment` (string): when set, adds an
  `environment:` key to the release job. This is optional but
  recommended together with trusted publishing so that releases
  must go through a configured GitHub Actions environment matching
  the one declared in PyPI's trusted publisher settings.

Closes PyO3#3166.

[1]: https://docs.pypi.org/trusted-publishers/
@messense messense force-pushed the feat/generate-ci-trusted-publishing branch from f1e96cb to 761d2c2 Compare May 7, 2026 11:51
@messense messense merged commit dd54ac9 into PyO3:main May 7, 2026
42 of 44 checks passed
@messense messense deleted the feat/generate-ci-trusted-publishing branch May 7, 2026 12:36
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.

Adding an option to generate-ci to use trusted publishing

1 participant