Skip to content

Commit fa1cd96

Browse files
author
ulises-jeremias
committed
ci: use GitHub Actions environment pypi for OIDC publish
Wire publish.yml to environment `pypi` so PyPI Trusted Publishers can match the recommended dedicated publishing environment.
1 parent be9bd0b commit fa1cd96

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414
jobs:
1515
release:
1616
runs-on: ubuntu-latest
17+
environment: pypi
1718
permissions:
1819
contents: write
1920
id-token: write

docs/DISTRIBUTION_SETUP.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,31 @@ Configure secrets under **Settings → Secrets and variables → Actions**.
1313

1414
## PyPI Trusted Publishing
1515

16-
Configure **two** pending Trusted Publishers on PyPI (same workflow publishes both packages):
16+
The Release job uses the GitHub Actions environment **`pypi`**
17+
(Settings → Environments). Configure **two** pending Trusted Publishers on PyPI
18+
(same workflow publishes both packages):
1719

1820
### `create-python-app-core`
1921

20-
1. Owner: `Create-Python-App`
21-
2. Repository: `create-python-app`
22-
3. Workflow: `publish.yml`
23-
4. Environment: (leave empty unless you use one)
22+
| Field | Value |
23+
|-------|--------|
24+
| PyPI Project Name | `create-python-app-core` |
25+
| Owner | `Create-Python-App` |
26+
| Repository name | `create-python-app` |
27+
| Workflow name | `publish.yml` |
28+
| Environment name | `pypi` |
2429

2530
### `create-awesome-python-app`
2631

27-
Same owner/repo/workflow as above.
32+
| Field | Value |
33+
|-------|--------|
34+
| PyPI Project Name | `create-awesome-python-app` |
35+
| Owner | `Create-Python-App` |
36+
| Repository name | `create-python-app` |
37+
| Workflow name | `publish.yml` |
38+
| Environment name | `pypi` |
2839

29-
On the first tag `create-awesome-python-app@0.1.0`, OIDC creates the projects and uploads sdists/wheels for both packages.
40+
On the first successful publish for tag `create-awesome-python-app@0.1.0`, OIDC creates the projects and uploads sdists/wheels for both packages.
3041

3142
## Cutting a release
3243

0 commit comments

Comments
 (0)