File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ test :
9+ runs-on : ubuntu-latest
10+ strategy :
11+ matrix :
12+ python-version : ["3.11", "3.12", "3.13"]
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - uses : astral-sh/setup-uv@v6
17+ with :
18+ python-version : ${{ matrix.python-version }}
19+
20+ - name : Install dependencies
21+ run : uv sync --dev
22+
23+ - name : Lint
24+ run : uv run ruff check .
25+
26+ - name : Type check
27+ run : uv run mypy src/
28+
29+ - name : Test
30+ run : uv run pytest
31+
32+ publish :
33+ needs : test
34+ runs-on : ubuntu-latest
35+ environment : pypi
36+ permissions :
37+ id-token : write
38+ steps :
39+ - uses : actions/checkout@v4
40+
41+ - uses : astral-sh/setup-uv@v6
42+
43+ - name : Set version from release tag
44+ run : |
45+ VERSION="${GITHUB_REF_NAME#v}"
46+ echo "Publishing version: $VERSION"
47+ sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
48+
49+ - name : Build package
50+ run : uv build
51+
52+ - name : Publish to PyPI
53+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments