Skip to content

Commit eb99aa7

Browse files
authored
Add CI/CD for deployment to pypi (#9)
1 parent d51115b commit eb99aa7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Triggers on version tags like v0.2.19, v1.0.0, etc.
7+
8+
jobs:
9+
publish:
10+
name: Build and publish to PyPI
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
with:
22+
enable-cache: true
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install dependencies
30+
run: |
31+
uv sync --dev
32+
33+
- name: Run linting
34+
run: |
35+
uv run ruff format ./src --check
36+
uv run ruff check ./src
37+
uv run mypy ./src
38+
39+
- name: Build package
40+
run: |
41+
uv build
42+
43+
- name: Publish to PyPI
44+
env:
45+
TWINE_USERNAME: __token__
46+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
47+
run: |
48+
uv run twine upload dist/*
49+

0 commit comments

Comments
 (0)