Skip to content

Commit a0b45ec

Browse files
committed
Add publish workflow for github
1 parent cfa0582 commit a0b45ec

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Upload Python Package to PyPI when a Release is Created
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
pypi-publish:
9+
name: Build and publish package to PyPI
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
18+
19+
- name: "Set up Python"
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version-file: ".python-version"
23+
24+
- name: Install the project
25+
run: uv sync --frozen --all-extras --dev
26+
27+
- name: Build
28+
run: uv build
29+
30+
- name: Upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: release-dists
34+
path: dist/
35+
36+
- name: Publish package to PyPI using uv
37+
env:
38+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
39+
run: uv publish

0 commit comments

Comments
 (0)