-
Notifications
You must be signed in to change notification settings - Fork 62
216 lines (196 loc) · 7.03 KB
/
build_wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Build wheels
run-name: Build wheels - ${{ github.sha }}
on:
push:
branches:
- 'master'
- 'release/**'
jobs:
build_windows_wheels:
strategy:
matrix:
py: [cp36, cp37, cp38, cp39, cp310, cp311, cp312]
arch:
- [AMD64, win_amd64, x64]
- [x86, win32, x86]
name: ${{ matrix.py }}-${{ matrix.arch[1] }}
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download compiled OpenBLAS
run: |
curl -L -o OpenBLAS-0.3.27.zip https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27-${{ matrix.arch[2] }}.zip
7z x OpenBLAS-0.3.27.zip -o"OpenBLAS"
- name: Set up the configuration file
run: |
python setup_site.py openblas libopenblas ${{ github.workspace }}\OpenBLAS\lib ${{ github.workspace }}\OpenBLAS\include
- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }}
uses: pypa/cibuildwheel@v2.19.1
env:
CIBW_PLATFORM: windows
CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }}
CIBW_ARCHS_WINDOWS: ${{ matrix.arch[0] }}
CIBW_BEFORE_BUILD_WINDOWS: >
pip install delvewheel
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
delvewheel repair --add-path ${{ github.workspace }}\OpenBLAS\bin -w {dest_dir} -v {wheel}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels_windows_${{ matrix.arch[0] }}
path: ./wheelhouse/*.whl
if-no-files-found: error
build_macos_wheels:
strategy:
matrix:
config:
[
{
py: cp36,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp37,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp38,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp39,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp310,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp311,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp312,
arch: [x86_64, macosx_x86_64, 10.9, macos-11]
},
{
py: cp38,
arch: [arm64, macosx_arm64, 11.0, macos-14]
},
{
py: cp39,
arch: [arm64, macosx_arm64, 11.0, macos-14]
},
{
py: cp310,
arch: [arm64, macosx_arm64, 11.0, macos-14]
},
{
py: cp311,
arch: [arm64, macosx_arm64, 11.0, macos-14]
},
{
py: cp312,
arch: [arm64, macosx_arm64, 11.0, macos-14]
}
]
name: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }}
runs-on: ${{ matrix.config.arch[3] }}
if:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download compiled OpenBLAS
uses: dawidd6/action-download-artifact@v6
with:
workflow: compile_openblas_macos.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: OpenBLAS_macos_${{ matrix.config.arch[0] }}
path: OpenBLAS
search_artifacts: true
- name: Install pipx # NOTE: required only for arm64
if: startsWith(matrix.config.arch[0], 'arm64')
run: |
brew install pipx
- name: Set up the configuration file
run: |
python3 setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include
- name: Build wheel ${{ matrix.config.py }}-${{ matrix.config.arch[1] }}
uses: pypa/cibuildwheel@v2.19.1
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.arch[2] }}
CIBW_PLATFORM: macos
CIBW_BUILD: ${{ matrix.config.py }}-${{ matrix.config.arch[1] }}
CIBW_ARCHS_MACOS: ${{ matrix.config.arch[0] }}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
DYLD_LIBRARY_PATH=${{ github.workspace }}/OpenBLAS/lib delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels_macos_${{ matrix.config.arch[0] }}
path: ./wheelhouse/*.whl
if-no-files-found: error
build_linux_wheels:
strategy:
matrix:
py: [cp36, cp37, cp38, cp39, cp310, cp311, cp312]
arch:
- [x86_64, manylinux_x86_64, amd64]
- [aarch64, manylinux_aarch64, arm64]
name: ${{ matrix.py }}-${{ matrix.arch[1] }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download compiled OpenBLAS
uses: dawidd6/action-download-artifact@v6
with:
workflow: compile_openblas_linux.yml
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: OpenBLAS_linux_${{ matrix.arch[0] }}
path: OpenBLAS
search_artifacts: true
- name: Set up the configuration file
run: | # NOTE: need to add '/host' because compilation is done in a Docker container
python setup_site.py openblas openblas /host${{ github.workspace }}/OpenBLAS/lib /host${{ github.workspace }}/OpenBLAS/include
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
with:
platforms: ${{ matrix.arch[2] }}
- name: Build wheel ${{ matrix.py }}-${{ matrix.arch[1] }}
uses: pypa/cibuildwheel@v2.19.1
env:
CIBW_PLATFORM: linux
CIBW_BUILD: ${{ matrix.py }}-${{ matrix.arch[1] }}
CIBW_ARCHS_LINUX: ${{ matrix.arch[0] }}
CIBW_REPAIR_WHEEL_COMMAND_LINUX: > # NOTE: need to add '/host' because compilation is done in a Docker container
LD_LIBRARY_PATH=/host${{ github.workspace }}/OpenBLAS/lib auditwheel repair -w {dest_dir} {wheel}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels_linux_${{ matrix.arch[0] }}
path: ./wheelhouse/*.whl
if-no-files-found: error
build_source_distribution:
name: sdist
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the configuration file
run: |
python setup_site.py openblas openblas ${{ github.workspace }}/OpenBLAS/lib ${{ github.workspace }}/OpenBLAS/include
- name: Build source distribution
run: |
pip install -U pip
pip install -U build
python -m build --sdist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
if-no-files-found: error