Skip to content

Commit de1c303

Browse files
committed
Document first-time PyPI trusted publisher setup
1 parent 484ed20 commit de1c303

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,21 @@ This template includes a GitHub Actions release workflow. To make a release:
8484
3. Enter the version (e.g. `0.5.0`) and run
8585

8686
The workflow validates the version, updates the changelog, creates a git tag and GitHub release,
87-
builds the wheel, publishes to PyPI (if configured), and attaches the `.whl` to the release.
87+
builds the wheel, publishes to PyPI, and attaches the `.whl` to the release.
8888

8989
Use **dry run** to preview without making changes.
9090

91+
### First-time PyPI setup
92+
93+
Before your first release, configure [trusted publishing](https://docs.pypi.org/trusted-publishers/)
94+
so the workflow can upload to PyPI without API tokens:
95+
96+
1. Go to https://pypi.org/manage/account/publishing/
97+
2. Add a new **pending publisher** with your GitHub repo, workflow `release.yml`,
98+
and environment `pypi`
99+
3. In your GitHub repo, go to **Settings > Environments** and create an environment
100+
named `pypi`
101+
91102
Versioning is handled automatically by [hatch-vcs](https://github.com/ofek/hatch-vcs): tagged
92103
commits get clean versions (e.g. `0.5.0`), untagged commits get dev versions
93104
(e.g. `0.5.1.dev3`).

0 commit comments

Comments
 (0)