1- name : Pip build
1+ name : Wheels
22
33on :
44 push :
5- branches :
5+ branches :
66 - main
77 pull_request :
88 branches :
1414 runs-on : ubuntu-latest
1515 steps :
1616 - uses : actions/checkout@v4
17+ with :
18+ submodules : true
1719
1820 - name : Build SDist
1921 run : pipx run build --sdist
@@ -23,102 +25,48 @@ jobs:
2325
2426 - uses : actions/upload-artifact@v4
2527 with :
26- name : artifact -sdist
28+ name : dist -sdist
2729 path : dist/*.tar.gz
2830
2931 build_wheels :
30- name : Build wheels ${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}
31- runs-on : ${{ matrix.os.runs-on }}
32-
33- env :
34- CIBW_BUILD_VERBOSITY : 3
35- # This is very dubious... It *may* work because these are just cpp libraries that should not depend on the python version. Still, super-dubious.
36- CIBW_TEST_REQUIRES : " gitpython"
37- CIBW_TEST_COMMAND : " python {project}/tests/test_basic.py"
38- CIBW_BUILD : " ${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}"
39- CIBW_TEST_SKIP : " *-macosx_arm64"
40- CIBW_ENVIRONMENT : " MAX_JOBS=${{ matrix.os.runs-on == 'macos-latest' && 3 || 2 }} PIP_CONSTRAINT=constraints.txt"
41- # Why universal2 here? It's not included above in CIBW_BUILD
42- CIBW_ARCHS_MACOS : " x86_64 arm64 universal2"
43- CIBW_ENVIRONMENT_MACOS : " MACOSX_DEPLOYMENT_TARGET=10.13 CMAKE_OSX_ARCHITECTURES=\" ${{ matrix.os.cibw-arch == 'macosx_x86_64' && 'x86_64' || matrix.os.cibw-arch == 'macosx_arm64' && 'arm64' || matrix.os.cibw-arch == 'macosx_universal2' && 'arm64;x86_64' || '' }}\" "
44-
32+ name : Build ${{ matrix.cpversion }} wheels on ${{ matrix.os }}
33+ runs-on : ${{ matrix.os }}
4534 strategy :
4635 fail-fast : false
4736 matrix :
48- # Launch separate job for each python. The build is so much longer than
49- # machine configuration/setup, so parallel builds will be faster. More
50- # importantly, github times out after 6 hours _per job_.
51- cpversion :
52- - cp36
53- - cp37
54- - cp38
55- - cp39
56- - cp310
57- - cp311
58- - cp312
59- os :
60- - runs-on : ubuntu-latest
61- cibw-arch : manylinux_x86_64
62- - runs-on : macos-latest
63- cibw-arch : macosx_x86_64
64- - runs-on : macos-latest
65- cibw-arch : macosx_arm64
66- - runs-on : windows-latest
67- cibw-arch : win_amd64
37+ os : [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
38+ # cp313 seemed to produce the same wheel name as cp312. Skip unless
39+ # necessary.
40+ cpversion : [cp38, cp39, cp310, cp311, cp312]
41+ # github actions cp38 on macos-14 runners are cross compiling or
42+ # something and confusing the stub generation. Just skip it for now.
43+ # Maybe it'd be friendlier to disable the stub generation for this
44+ # combination.
6845 exclude :
69- - cpversion : cp36
70- os :
71- runs-on : macos-latest
72- cibw-arch : macosx_arm64
73- - cpversion : cp37
74- os :
75- runs-on : macos-latest
76- cibw-arch : macosx_arm64
46+ - os : macos-14
47+ cpversion : cp38
48+
7749
7850 steps :
7951 - uses : actions/checkout@v4
8052
81- - name : Install Python
82- uses : actions/setup-python@v5
53+ - uses : actions/setup-python@v5
8354 with :
84- python-version : " 3.x "
55+ python-version : ' 3.12 '
8556
8657 - name : Install cibuildwheel
87- run : |
88- python -m pip install --upgrade pip
89- python -m pip install cibuildwheel
58+ run : python -m pip install cibuildwheel==2.22.0
9059
9160 - name : Build wheels
92- shell : bash
93- run : |
94- PIP_CONSTRAINT=$GITHUB_WORKSPACE/constraints.txt python -m cibuildwheel --output-dir wheelhouse
61+ # why do I need to specify this cpversion here?
62+ env :
63+ CIBW_ARCHS : " auto64"
64+ CIBW_BUILD : " ${{ matrix.cpversion }}-*"
65+ # why isn't auto64 working?
66+ CIBW_SKIP : " cp*-manylinux_i686 cp*-musllinux* cp*-win32"
67+ run : python -m cibuildwheel --output-dir wheelhouse
9568
96- # Upload binaries to github
9769 - uses : actions/upload-artifact@v4
9870 with :
99- name : artifact-wheel-${{ matrix.cpversion }}-${{ matrix.os.cibw-arch }}
100- path : |-
101- ./wheelhouse/*.whl
102- ./wheelhouse/*.tar.gz
103-
104- # # Push the resulting binaries to pypi on a tag starting with 'v'
105- upload_pypi :
106- needs : build_wheels
107- runs-on : ubuntu-latest
108- # upload to PyPI on every tag starting with 'v'
109- # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
110- # alternatively, to publish when a GitHub Release is created, use the following rule:
111- if : github.event_name == 'release' && github.event.action == 'published'
112- steps :
113- - uses : actions/download-artifact@v4
114- with :
115- pattern : artifact-*
116- merge-multiple : true
117- path : dist
118-
119- 120- with :
121- user : __token__
122- password : ${{ secrets.pypi_password }}
123- skip_existing : true
124- # To test: repository_url: https://test.pypi.org/legacy/
71+ name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
72+ path : ./wheelhouse/*.whl
0 commit comments