5656 submodules : true
5757
5858 - name : Set up Python
59- uses : actions/setup-python@v2
59+ uses : actions/setup-python@v4
6060
6161 - name : Build source distribution
6262 run : |
@@ -68,19 +68,35 @@ jobs:
6868 name : dist
6969 path : dist/*.tar.*
7070
71- build-wheels :
71+ build-wheels-matrix :
7272 needs : validate-release-request
73+ runs-on : ubuntu-latest
74+ outputs :
75+ include : ${{ steps.set-matrix.outputs.include }}
76+ steps :
77+ - uses : actions/checkout@v2
78+ - uses : actions/setup-python@v4
79+ - run : pip install cibuildwheel==2.10.2
80+ - id : set-matrix
81+ run : |
82+ MATRIX_INCLUDE=$(
83+ {
84+ cibuildwheel --print-build-identifiers --platform linux --arch x86_64,aarch64 | grep cp | jq -Rc '{"only": inputs, "os": "ubuntu-latest"}' \
85+ && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | grep cp | jq -Rc '{"only": inputs, "os": "macos-latest"}' \
86+ && cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -Rc '{"only": inputs, "os": "windows-latest"}'
87+ } | jq -sc
88+ )
89+ echo ::set-output name=include::"$MATRIX_INCLUDE"
90+
91+ build-wheels :
92+ needs : build-wheels-matrix
7393 runs-on : ${{ matrix.os }}
94+ continue-on-error : true
95+ name : Build ${{ matrix.only }}
96+
7497 strategy :
7598 matrix :
76- os : [ubuntu-latest, macos-latest, windows-latest]
77- cibw_python : ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
78- cibw_arch : ["auto64", "auto32"]
79- exclude :
80- - os : macos-latest
81- cibw_arch : " auto32"
82- - os : ubuntu-latest
83- cibw_arch : " auto32"
99+ include : ${{ fromJson(needs.build-wheels-matrix.outputs.include) }}
84100
85101 defaults :
86102 run :
@@ -94,20 +110,26 @@ jobs:
94110 with :
95111 fetch-depth : 50
96112 submodules : true
113+
114+ - name : Set up QEMU
115+ if : runner.os == 'Linux'
116+ uses : docker/setup-qemu-action@v2
97117
98- - uses : pypa/cibuildwheel@v2.8.0
118+ - uses : pypa/cibuildwheel@v2.10.2
119+ with :
120+ only : ${{ matrix.only }}
99121 env :
100122 CIBW_BUILD_VERBOSITY : 1
101- CIBW_BUILD : ${{ matrix.cibw_python }}
102- CIBW_ARCHS : ${{ matrix.cibw_arch }}
123+ CIBW_MANYLINUX_X86_64_IMAGE : manylinux_2_28
124+ CIBW_MANYLINUX_AARCH64_IMAGE : manylinux_2_28
103125
104126 - uses : actions/upload-artifact@v2
105127 with :
106128 name : dist
107129 path : wheelhouse/*.whl
108130
109131 publish-docs :
110- needs : validate-release-request
132+ needs : [build-sdist, build-wheels]
111133 runs-on : ubuntu-latest
112134
113135 env :
@@ -121,7 +143,7 @@ jobs:
121143 submodules : true
122144
123145 - name : Set up Python
124- uses : actions/setup-python@v2
146+ uses : actions/setup-python@v4
125147 with :
126148 python-version : 3.8
127149
0 commit comments