Skip to content

Commit 4a2b5fa

Browse files
committed
fix: add simplified manual PyPI publish workflow and setup guide
- Add publish-manual.yml for simpler trusted publishing setup - Add comprehensive PyPI trusted publisher configuration guide - Document exact values needed for PyPI configuration
1 parent 7724d3d commit 4a2b5fa

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Manual PyPI Publish
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
name: Publish to PyPI
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
id-token: write
13+
contents: read
14+
15+
steps:
16+
# Use current branch/tag
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install build dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install build
28+
29+
- name: Build distribution
30+
run: python -m build
31+
32+
- name: Publish to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1

PYPI_TRUSTED_PUBLISHER_SETUP.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# PyPI Trusted Publisher Setup Guide
2+
3+
## Current Error
4+
The error message shows these claims from your GitHub Action:
5+
- `sub`: `repo:PSPDFKit/nutrient-dws-client-python:ref:refs/heads/main`
6+
- `repository`: `PSPDFKit/nutrient-dws-client-python`
7+
- `repository_owner`: `PSPDFKit`
8+
- `workflow_ref`: `PSPDFKit/nutrient-dws-client-python/.github/workflows/publish-existing-tag.yml@refs/heads/main`
9+
10+
## Configure PyPI Trusted Publisher
11+
12+
1. Go to https://pypi.org/manage/project/nutrient-dws/settings/publishing/
13+
2. Under "Trusted Publishers", click "Add a new publisher"
14+
3. Select "GitHub" as the publisher type
15+
4. Fill in the following:
16+
17+
### For Workflow Dispatch (Manual Trigger)
18+
- **Repository owner**: `PSPDFKit`
19+
- **Repository name**: `nutrient-dws-client-python`
20+
- **Workflow name**: `publish-existing-tag.yml`
21+
- **Environment name**: (leave empty)
22+
23+
### For Release Workflow
24+
Add another trusted publisher:
25+
- **Repository owner**: `PSPDFKit`
26+
- **Repository name**: `nutrient-dws-client-python`
27+
- **Workflow name**: `release.yml`
28+
- **Environment name**: (leave empty)
29+
30+
### For Simple Manual Workflow
31+
Add another trusted publisher:
32+
- **Repository owner**: `PSPDFKit`
33+
- **Repository name**: `nutrient-dws-client-python`
34+
- **Workflow name**: `publish-manual.yml`
35+
- **Environment name**: (leave empty)
36+
37+
## Important Notes
38+
39+
1. The workflow name must match EXACTLY (including the `.yml` extension)
40+
2. Do NOT include `.github/workflows/` in the workflow name
41+
3. Environment should be left empty unless you're using GitHub environments
42+
4. The repository owner must match the GitHub organization/user exactly (case-sensitive)
43+
44+
## Alternative: Publish from v1.0.2 Tag
45+
46+
If you want to publish directly from the tag, you could:
47+
1. Go to the v1.0.2 tag on GitHub
48+
2. Run the `publish-manual.yml` workflow from that tag
49+
3. This would make the ref claim match `refs/tags/v1.0.2`
50+
51+
## Debugging
52+
53+
To see what claims your workflow is sending:
54+
1. Run the workflow again
55+
2. Check the error message for the exact claims
56+
3. Ensure your PyPI configuration matches those claims exactly
57+
58+
## Quick Test
59+
60+
After configuring the trusted publisher:
61+
1. Try the simplest workflow first: `publish-manual.yml`
62+
2. Run it from the main branch
63+
3. If it works, then try the tag-specific workflows

0 commit comments

Comments
 (0)