Skip to content

Commit d8d3c81

Browse files
Allow2CEOruvnet
andcommitted
Add CI/CD workflows for PyPI publishing and GitHub Releases
- ci.yml: lint (ruff), type check (mypy), test (pytest) across Python 3.10-3.13 - publish.yml: on v* tags, build wheel+sdist, publish to PyPI via OIDC trusted publishing, create GitHub Release with artifacts attached Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent 2d9c31a commit d8d3c81

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: pip install -e ".[dev]"
26+
27+
- name: Lint with ruff
28+
run: ruff check .
29+
30+
- name: Type check with mypy
31+
run: mypy .
32+
33+
- name: Run tests
34+
run: pytest

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
18+
- name: Install build tools
19+
run: pip install build
20+
21+
- name: Build sdist and wheel
22+
run: python -m build
23+
24+
- name: Upload build artifacts
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: dist
28+
path: dist/
29+
30+
publish-pypi:
31+
needs: build
32+
runs-on: ubuntu-latest
33+
environment: pypi
34+
permissions:
35+
id-token: write
36+
steps:
37+
- name: Download build artifacts
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
43+
- name: Publish to PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1
45+
46+
github-release:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
permissions:
50+
contents: write
51+
steps:
52+
- name: Download build artifacts
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: dist
56+
path: dist/
57+
58+
- name: Create GitHub Release
59+
uses: softprops/action-gh-release@v2
60+
with:
61+
files: dist/*
62+
generate_release_notes: true

0 commit comments

Comments
 (0)