Skip to content

Commit 1eb0be1

Browse files
vosesoftclaude
andcommitted
ci: add CI (ruff/mypy/pytest) + tag-driven PyPI release workflows
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b980166 commit 1eb0be1

2 files changed

Lines changed: 91 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions: {}
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.11", "3.12"]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
with:
22+
enable-cache: true
23+
- name: Set up Python ${{ matrix.python-version }}
24+
run: uv python install ${{ matrix.python-version }}
25+
- name: Sync (with dev extras)
26+
run: uv sync --extra dev
27+
- name: Ruff
28+
run: uv run ruff check src tests
29+
- name: Mypy
30+
run: uv run mypy src
31+
- name: Pytest
32+
run: uv run pytest -q

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Release pipeline. On a version tag (v*), build the wheel + sdist,
2+
# publish to PyPI via trusted publishing, and cut a GitHub release.
3+
#
4+
# One-time setup before the first tag:
5+
# 1. Create the PyPI project's trusted publisher
6+
# (https://pypi.org/manage/account/publishing/) pointing at this
7+
# repo + this workflow under the environment name "pypi". No tokens.
8+
name: Release
9+
10+
on:
11+
push:
12+
tags:
13+
- "v*"
14+
15+
permissions: {}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
24+
- name: Build sdist + wheel
25+
run: uv build
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: dist
29+
path: dist/
30+
31+
publish-pypi:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
environment: pypi
35+
permissions:
36+
id-token: write # PyPI trusted publishing
37+
steps:
38+
- uses: actions/download-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
- name: Publish to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
45+
github-release:
46+
needs: publish-pypi
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
name: dist
54+
path: dist/
55+
- name: Create GitHub release
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
files: dist/*
59+
generate_release_notes: true

0 commit comments

Comments
 (0)