@@ -59,33 +59,48 @@ jobs:
59
59
python -m pip install -U setuptools wheel pip
60
60
python setup.py sdist
61
61
62
- - uses : actions/upload-artifact@v2
62
+ - uses : actions/upload-artifact@v3
63
63
with :
64
64
name : dist
65
65
path : dist/*.tar.*
66
66
67
- build-wheels :
67
+ build-wheels-matrix :
68
68
needs : validate-release-request
69
+ runs-on : ubuntu-latest
70
+ outputs :
71
+ include : ${{ steps.set-matrix.outputs.include }}
72
+ steps :
73
+ - uses : actions/checkout@v3
74
+ - uses : actions/setup-python@v4
75
+ with :
76
+ python-version : " 3.x"
77
+ - run : pip install cibuildwheel==2.15.0
78
+ - id : set-matrix
79
+ run : |
80
+ MATRIX_INCLUDE=$(
81
+ {
82
+ cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
83
+ && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \
84
+ && cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-latest"}'
85
+ } | jq -sc
86
+ )
87
+ echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT
88
+
89
+ build-wheels :
90
+ needs : build-wheels-matrix
69
91
runs-on : ${{ matrix.os }}
92
+ name : Build ${{ matrix.only }}
93
+
70
94
strategy :
71
95
matrix :
72
- os : [ubuntu-latest, macos-latest, windows-latest]
73
- cibw_arch : ["auto64", "aarch64", "universal2"]
74
- cibw_python :
75
- - " cp38-*"
76
- - " cp39-*"
77
- - " cp310-*"
78
- - " cp311-*"
79
- - " cp312-*"
80
- exclude :
81
- - os : ubuntu-latest
82
- cibw_arch : universal2
83
- - os : macos-latest
84
- cibw_arch : aarch64
85
- - os : windows-latest
86
- cibw_arch : universal2
87
- - os : windows-latest
88
- cibw_arch : aarch64
96
+ include : ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}
97
+
98
+ defaults :
99
+ run :
100
+ shell : bash
101
+
102
+ env :
103
+ PIP_DISABLE_PIP_VERSION_CHECK : 1
89
104
90
105
steps :
91
106
- uses : actions/checkout@v3
@@ -94,23 +109,17 @@ jobs:
94
109
submodules : true
95
110
96
111
- name : Set up QEMU
97
- if : matrix .os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64 '
112
+ if : runner .os == 'Linux '
98
113
uses : docker/setup-qemu-action@v2
99
- with :
100
- platforms : arm64
101
114
102
-
115
+ - uses : pypa/cibuildwheel@39a63b5912f086dd459cf6fcb13dcdd3fe3bc24d # v2.15.0
116
+ with :
117
+ only : ${{ matrix.only }}
103
118
env :
104
119
CIBW_BUILD_VERBOSITY : 1
105
- CIBW_BUILD : ${{ matrix.cibw_python }}
106
- CIBW_ARCHS : ${{ matrix.cibw_arch }}
107
- CIBW_TEST_EXTRAS : " test"
108
- CIBW_TEST_COMMAND : " cd .. && python {project}/tests/__init__.py"
109
- CIBW_TEST_COMMAND_WINDOWS : " cd .. && python {project}\\ tests\\ __init__.py"
110
- CIBW_TEST_SKIP : " *universal2:arm64"
111
120
CIBW_ENVIRONMENT : " IMMU_SKIP_MYPY_TESTS=1"
112
121
113
- - uses : actions/upload-artifact@v2
122
+ - uses : actions/upload-artifact@v3
114
123
with :
115
124
name : dist
116
125
path : wheelhouse/*.whl
0 commit comments