-
Notifications
You must be signed in to change notification settings - Fork 36
244 lines (210 loc) · 7.82 KB
/
wheels.yaml
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
name: Building Wheels
on:
push:
tags:
- "*"
schedule:
# Scheduled workflows run on the latest commit on the default or base branch
- cron: "0 0 1 * *"
workflow_dispatch:
inputs:
reason:
description: Reason for manually triggering workflow
required: true
jobs:
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
# NOTE: The ARM build(s) take considerably longer on GitHub Actions.
- artifact-name: linux-arm-3.10
cibw-archs: aarch64
cibw-build: cp310-*
- artifact-name: linux-arm-3.11
cibw-archs: aarch64
cibw-build: cp311-*
- artifact-name: linux-arm-3.12
cibw-archs: aarch64
cibw-build: cp312-*
- artifact-name: linux-intel
cibw-archs: x86_64
cibw-build: >-
cp310-*
cp311-*
cp312-*
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
if: matrix.cibw-archs == 'aarch64'
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
CIBW_ARCHS: ${{ matrix.cibw-archs }}
CIBW_BEFORE_BUILD: |
python -m pip install cmake nox numpy
nox --session libbezier-release
CIBW_BUILD: ${{ matrix.cibw-build }}
CIBW_ENVIRONMENT: >-
BEZIER_INSTALL_PREFIX=/project/.nox/.cache/libbezier-release/usr
LD_LIBRARY_PATH=/project/.nox/.cache/libbezier-release/usr/lib
TARGET_NATIVE_ARCH=OFF
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: "pytest scipy sympy"
CIBW_SKIP: "*musllinux*"
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ matrix.artifact-name }}
path: ./wheelhouse/*.whl
macos-arm64:
runs-on: macos-14
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Install `gcc`
run: |
brew install gcc
brew unlink gcc
brew link gcc
- name: Build `libbezier`
env:
TARGET_NATIVE_ARCH: "OFF"
run: |
python3.12 -m pip install cmake nox
nox --session libbezier-release
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
BEZIER_INSTALL_PREFIX: ./.nox/.cache/libbezier-release/usr
CIBW_ARCHS: arm64
CIBW_BEFORE_BUILD: |
python -m pip install numpy
CIBW_BUILD: >-
cp310-*
cp311-*
cp312-*
CIBW_ENVIRONMENT: >-
MACOSX_DEPLOYMENT_TARGET=14.0
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: "pytest scipy sympy"
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: macos-arm64
path: ./wheelhouse/*.whl
macos-x86-64:
runs-on: macos-14
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Install `homebrew` in x86_64 arch
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install `gcc` in x86_64 `homebrew
run: |
arch -x86_64 /usr/local/bin/brew install gcc
- name: Build `libbezier`
env:
TARGET_NATIVE_ARCH: "OFF"
# NOTE: Could also use $(brew --prefix gcc)/bin/gfortran
CMAKE_FORTRAN_COMPILER: /usr/local/bin/gfortran
run: |
python3.12 -m pip install cmake nox
nox --session libbezier-release
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
BEZIER_INSTALL_PREFIX: ./.nox/.cache/libbezier-release/usr
CIBW_ARCHS: x86_64
CIBW_BEFORE_BUILD: |
python -m pip install numpy
CIBW_BUILD: >-
cp310-*
cp311-*
cp312-*
CIBW_ENVIRONMENT: >-
MACOSX_DEPLOYMENT_TARGET=14.0
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: "pytest scipy sympy"
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: macos-x86-64
path: ./wheelhouse/*.whl
sdist:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Install build dependencies
run: |
python3.12 -m pip install build
- name: Generate sdist (source distribution)
env:
BEZIER_NO_EXTENSION: "True"
run: |
python3.12 -m build --sdist .
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: sdist
path: ./dist/*.tar.gz
windows-intel:
runs-on: windows-2022
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Build `libbezier`
env:
TARGET_NATIVE_ARCH: "OFF"
run: |
py -3.12 -m pip install cmake nox
nox --session libbezier-release
# MinGW is installed (by default) via Chocolatey:
# - https://github.com/actions/runner-images/blob/win22%2F20230724.1/images/win/toolsets/toolset-2022.json#L165
# - https://community.chocolatey.org/packages/mingw/11.2.0.07112021
# - https://github.com/actions/runner-images/issues/6103
- name: Add MinGW bin dir to PATH
shell: powershell
run: |
"C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH
- name: Build wheels
uses: pypa/cibuildwheel@932529cab190fafca8c735a551657247fa8f8eaf # v2.19.1
env:
BEZIER_INSTALL_PREFIX: .\.nox\.cache\libbezier-release\usr
CIBW_ARCHS: AMD64
CIBW_BEFORE_BUILD: |
python -m pip install delvewheel numpy
CIBW_BUILD: >-
cp310-*
cp311-*
cp312-*
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair
--wheel-dir {dest_dir}
--add-path .\.nox\.cache\libbezier-release\usr\bin
{wheel}
CIBW_TEST_COMMAND: pytest {project}/tests/unit
CIBW_TEST_REQUIRES: "pytest scipy sympy"
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: windows-intel
path: .\wheelhouse\*.whl