6
6
7
7
jobs :
8
8
build_wheels :
9
- name : Build wheels on ${{ matrix.os }}
9
+ name : Build wheels on ${{ matrix.os }} for Python ${{ matrix.python-version }}
10
10
runs-on : ${{ matrix.os }}
11
11
strategy :
12
12
matrix :
13
- # macos-13 is an intel runner, macos-14 is apple silicon
14
13
os : [ubuntu-latest]
14
+ python-version : ["3.10", "3.11", "3.12"] # Specify the Python versions here
15
15
16
16
steps :
17
17
- uses : actions/checkout@v4
18
18
19
- - name : Build wheels
19
+ - name : Set up Python ${{ matrix.python-version }}
20
+ uses : actions/setup-python@v4
21
+ with :
22
+ python-version : ${{ matrix.python-version }} # Use matrix to set Python version
23
+
24
+ - name : Install dependencies
25
+ run : |
26
+ python -m pip install --upgrade pip
27
+ pip install build cibuildwheel
28
+
29
+ - name : Build wheels with cibuildwheel
20
30
31
+ with :
32
+ # Builds for specific Python versions specified in matrix
33
+ python-version : ${{ matrix.python-version }}
21
34
env :
22
- CIBW_BUILD : " cp310-* cp311-* cp312-*"
23
- CIBW_BUILD_VERBOSITY : 2
35
+ CIBW_BUILD : " cp${{ matrix.python-version }}-*"
36
+ CIBW_SKIP : " pp*" # Skip non-CPython implementations
37
+
24
38
- uses : actions/upload-artifact@v4
25
39
with :
26
- name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
40
+ name : cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}
27
41
path : ./wheelhouse/*.whl
28
42
29
43
build_sdist :
@@ -47,16 +61,11 @@ jobs:
47
61
permissions :
48
62
id-token : write
49
63
if : github.event_name == 'release' && github.event.action == 'published'
50
- # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
51
- # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
52
64
steps :
53
65
- uses : actions/download-artifact@v4
54
66
with :
55
- # unpacks all CIBW artifacts into dist/
56
67
pattern : cibw-*
57
68
path : dist
58
69
merge-multiple : true
59
70
60
71
- uses : pypa/gh-action-pypi-publish@release/v1
61
- # with:
62
- # repository-url: https://test.pypi.org/legacy/
0 commit comments