Skip to content

Commit 5d93ea3

Browse files
committed
feat(release): publish tagged artifacts to TestPyPI
1 parent 28ef75f commit 5d93ea3

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,36 @@ jobs:
9292
with:
9393
name: rapidobj-wheels-${{ matrix.os }}
9494
path: wheelhouse/*.whl
95+
96+
publish-testpypi:
97+
name: Publish to TestPyPI
98+
runs-on: ubuntu-latest
99+
needs:
100+
- sdist
101+
- wheels
102+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
103+
environment:
104+
name: testpypi
105+
url: https://test.pypi.org/p/rapidobj
106+
permissions:
107+
id-token: write
108+
contents: read
109+
110+
steps:
111+
- name: Download sdist artifact
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: rapidobj-sdist
115+
path: dist
116+
117+
- name: Download wheel artifacts
118+
uses: actions/download-artifact@v4
119+
with:
120+
pattern: rapidobj-wheels-*
121+
merge-multiple: true
122+
path: dist
123+
124+
- name: Publish package distributions to TestPyPI
125+
uses: pypa/gh-action-pypi-publish@release/v1
126+
with:
127+
repository-url: https://test.pypi.org/legacy/

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ python -m pip install dist/rapidobj-0.1.0-cp312-cp312-*.whl
2222

2323
For release builds, GitHub Actions is the authoritative wheel pipeline. Pull
2424
requests validate the package, and version tags build Linux and Windows wheels
25-
for CPython 3.12, 3.13, and 3.14.
25+
for CPython 3.12, 3.13, and 3.14. Tag builds also publish the validated
26+
artifacts to TestPyPI via Trusted Publishing.
2627

2728
## Minimal Usage
2829

RELEASE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Use semantic version tags: `vX.Y.Z`.
3232
- build Linux and Windows wheel artifacts
3333
- run metadata checks and smoke tests
3434
- upload artifacts to GitHub Actions
35+
- publish those exact artifacts to TestPyPI via Trusted Publishing
3536

3637
## GitHub Source Release
3738

@@ -42,8 +43,14 @@ Use semantic version tags: `vX.Y.Z`.
4243
3. Wait for the release workflow to finish and download the generated artifacts if needed.
4344
4. Create GitHub release from the tag and include changelog notes.
4445

46+
## TestPyPI Publish
47+
48+
1. Configure a Trusted Publisher for the repository on TestPyPI.
49+
2. Push a version tag (`vX.Y.Z`).
50+
3. Wait for the `Release Artifacts` workflow to finish.
51+
4. Verify the package page and an install from TestPyPI.
52+
4553
## PyPI Publish
4654

47-
1. Upload validated artifacts from the GitHub release workflow:
48-
- `uvx --from twine twine upload dist/*`
49-
2. Verify package page metadata and install command.
55+
1. After TestPyPI validation, point the publish job at production PyPI.
56+
2. Reuse the same tag-triggered artifact publish flow with Trusted Publishing.

0 commit comments

Comments
 (0)