11name : Publish to PyPI
22
33on :
4- release :
5- types : [published]
4+ push :
5+ tags :
6+ - " v*"
67
78permissions :
89 contents : write
1213 PROJECT_NAME : typeid-python
1314
1415jobs :
15- test :
16- runs-on : ubuntu-latest
17- strategy :
18- fail-fast : false
19- matrix :
20- python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
21-
22- steps :
23- - name : Checkout
24- uses : actions/checkout@v4
25- with :
26- fetch-depth : 9
27- submodules : false
28-
29- - name : Set up Python ${{ matrix.python-version }}
30- uses : actions/setup-python@v5
31- with :
32- python-version : ${{ matrix.python-version }}
33-
34- - name : Install uv
35- uses : astral-sh/setup-uv@v3
36-
37- - name : Sync dependencies (locked)
38- run : |
39- uv sync --locked --all-groups
40-
41- - name : Run tests
42- run : |
43- make test
44-
45- - name : Run linters
46- run : |
47- make check-linting
48-
4916 test-native :
5017 name : Build + import native extension (${{ matrix.os }}, py${{ matrix.python-version }})
5118 runs-on : ${{ matrix.os }}
52- needs :
53- - test
5419 strategy :
5520 fail-fast : false
5621 matrix :
5722 os : [ubuntu-latest, macos-latest, windows-latest]
5823 python-version : ["3.11"]
5924
6025 steps :
61- - name : Checkout
62- uses : actions/checkout@v4
26+ - uses : actions/checkout@v4
6327
64- - name : Set up Python ${{ matrix.python-version }}
65- uses : actions/setup-python@v5
28+ - uses : actions/setup-python@v5
6629 with :
6730 python-version : ${{ matrix.python-version }}
6831
69- - name : Install Rust
70- uses : dtolnay/rust-toolchain@stable
32+ - uses : dtolnay/rust-toolchain@stable
33+
34+ - uses : astral-sh/setup-uv@v3
35+
36+ - name : Create .venv + install deps
37+ run : |
38+ uv sync --locked --all-groups
7139
72- # Build & install the package in-place with the extension
7340 - name : Build & install (maturin develop)
7441 uses : PyO3/maturin-action@v1
7542 with :
@@ -78,13 +45,13 @@ jobs:
7845
7946 - name : Sanity check (import extension)
8047 run : |
81- python -c "import typeid; import typeid._base32; print('native ext OK')"
48+ uv run python -c "import typeid; import typeid._base32; print('native ext OK')"
8249
8350
8451 build-wheels :
8552 name : Build wheels (${{ matrix.os }}, py${{ matrix.python-version }})
8653 runs-on : ${{ matrix.os }}
87- needs : test-native
54+ needs : [ test-native]
8855 strategy :
8956 fail-fast : false
9057 matrix :
11178 with :
11279 command : build
11380 args : --release --out dist
114- working-directory : rust-base32
11581 manylinux : " 2_28"
11682
11783 - name : Upload wheels
12288
12389 build-sdist :
12490 runs-on : ubuntu-latest
125- needs : build-wheels
91+ needs : [ build-wheels]
12692 steps :
12793 - name : Checkout
12894 uses : actions/checkout@v4
@@ -152,7 +118,7 @@ jobs:
152118
153119 publish-package :
154120 runs-on : ubuntu-latest
155- needs : build-sdist
121+ needs : [ build-sdist]
156122 permissions :
157123 contents : read
158124 id-token : write
@@ -176,7 +142,7 @@ jobs:
176142
177143 publish-docs :
178144 runs-on : ubuntu-latest
179- needs : publish-package
145+ needs : [ publish-package]
180146 steps :
181147 - uses : actions/checkout@v4
182148
0 commit comments