Skip to content

Commit d3cef71

Browse files
committed
Add PYPI Publishing
1 parent a9058f1 commit d3cef71

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/pypi.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version-file: "pyproject.toml"
23+
24+
- name: Build release distributions
25+
run: uv build
26+
27+
28+
- name: Publish to TestPyPI (dev branch)
29+
if: github.event.release.target_commitish == 'dev'
30+
run: uv publish --index testpypi
31+
32+
- name: Publish to PyPI (main branch)
33+
if: github.event.release.target_commitish == 'main'
34+
run: uv publish --index pypi

0 commit comments

Comments
 (0)