Skip to content

Commit 8544311

Browse files
committed
Add tag-driven PyPI publish workflow
Trusted Publishing via GitHub OIDC: pushing a v* tag runs the test suite, builds sdist+wheel, and publishes to PyPI through the pypi environment. No API tokens stored anywhere; PyPI must have the matching pending publisher configured (project listingsapi, owner synup, repo listingsapi-python-sdk, workflow publish.yml, environment pypi).
1 parent 47637a6 commit 8544311

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.12'
16+
- run: pip install -e ".[dev]"
17+
- run: pytest
18+
19+
publish:
20+
needs: test
21+
runs-on: ubuntu-latest
22+
environment: pypi
23+
permissions:
24+
id-token: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.12'
30+
- run: pip install build
31+
- run: python -m build
32+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)