Skip to content

Commit 3ce8ef6

Browse files
author
Rudolf Schmidt
committed
ci: Add CI and tag-triggered PyPI publish workflows
1 parent c1a5fd2 commit 3ce8ef6

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python: ["3.13", "3.14"]
14+
name: Test (Python ${{ matrix.python }})
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: astral-sh/setup-uv@v5
19+
20+
- name: Install Python
21+
run: uv python install ${{ matrix.python }}
22+
23+
- name: Install dependencies
24+
run: uv sync --extra dev
25+
26+
- name: Run tests
27+
run: uv run pytest --tb=short -q
28+
29+
lint:
30+
runs-on: ubuntu-latest
31+
name: Lint & Types
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: astral-sh/setup-uv@v5
36+
37+
- name: Install Python
38+
run: uv python install 3.13
39+
40+
- name: Install dependencies
41+
run: uv sync --extra dev
42+
43+
- name: Ruff check
44+
run: uv run ruff check src/ tests/
45+
46+
- name: Ruff format
47+
run: uv run ruff format --check src/ tests/
48+
49+
- name: Mypy
50+
run: uv run mypy src/

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
name: Build & Publish
11+
permissions:
12+
id-token: write
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: astral-sh/setup-uv@v5
18+
19+
- name: Install Python
20+
run: uv python install 3.13
21+
22+
- name: Build package
23+
run: uv build
24+
25+
- name: Publish to PyPI
26+
run: uv publish --trusted-publishing always
27+
28+
- name: Create GitHub Release
29+
run: gh release create ${{ github.ref_name }} dist/* --generate-notes
30+
env:
31+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)