-
Notifications
You must be signed in to change notification settings - Fork 1
267 lines (220 loc) · 7.46 KB
/
release.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
---
name: Release to PyPI
on:
release:
types: [published]
branches:
- 'main'
jobs:
build-manylinux:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/[email protected]
with:
path: io
- name: Set permissions for build.sh
run: chmod +x io/build.sh
- name: Build Wheels
run: >
docker run --rm
-e PLAT=manylinux2014_x86_64
-e PACKAGE_NAME=orso
-e PYTHON_VERSION=${{ matrix.python-version }}
-v `pwd`:/io
--workdir /io
quay.io/pypa/manylinux2014_x86_64
io/build.sh
- name: Archive Wheels
uses: actions/upload-artifact@v4
with:
name: dist-linux-${{ matrix.python-version }}
path: io/dist/*manylinux2014_x86_64.whl
build-macos:
runs-on: macos-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/[email protected]
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Set up Python ${{ matrix.python-version }} x64
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python package dependencies
run: python -m pip install --upgrade cython wheel numpy setuptools_rust
- name: Install Rust aarch64-apple-darwin target
run: rustup target add aarch64-apple-darwin
- name: Build on macOS universal2
shell: bash
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: '10.15'
ARCHFLAGS: -arch x86_64 -arch arm64
PYO3_CROSS_LIB_DIR: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/${{ matrix.python-version }}/lib
run: python setup.py bdist_wheel
- name: Archive dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist-macos-${{ matrix.python-version }}
path: dist
build-windows:
runs-on: windows-latest
strategy:
max-parallel: 3
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/[email protected]
- name: Download Build Tools for Visual Studio 2019
run: Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools.exe
- name: Run vs_buildtools.exe install
run: ./vs_buildtools.exe --quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.140 --includeRecommended
- name: Set up Python ${{ matrix.python-version }} x64
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Python package dependencies
run: python -m pip install --upgrade cython wheel numpy setuptools_rust
- name: Build binary wheel
run: python setup.py bdist_wheel
- name: Archive dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist-windows-${{ matrix.python-version }}
path: dist
upload:
needs:
- build-manylinux
- build-macos
- build-windows
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade cython wheel numpy setuptools_rust
python -m pip install --upgrade -r requirements.txt
- name: Create source dist
run: python setup.py sdist
- name: Stage linux 3.9
uses: actions/[email protected]
with:
name: dist-linux-3.9
path: dist-linux-3.9
- run: mv -v dist-linux-3.9/* dist/
- name: Stage linux 3.10
uses: actions/[email protected]
with:
name: dist-linux-3.10
path: dist-linux-3.10
- run: mv -v dist-linux-3.10/* dist/
- name: Stage linux 3.11
uses: actions/[email protected]
with:
name: dist-linux-3.11
path: dist-linux-3.11
- run: mv -v dist-linux-3.11/* dist/
- name: Stage linux 3.12
uses: actions/[email protected]
with:
name: dist-linux-3.12
path: dist-linux-3.12
- run: mv -v dist-linux-3.12/* dist/
- name: Stage macos 3.9
uses: actions/[email protected]
with:
name: dist-macos-3.9
path: dist-macos-3.9
- run: mv -v dist-macos-3.9/* dist/
- name: Stage macos 3.10
uses: actions/[email protected]
with:
name: dist-macos-3.10
path: dist-macos-3.10
- run: mv -v dist-macos-3.10/* dist/
- name: Stage macos 3.11
uses: actions/[email protected]
with:
name: dist-macos-3.11
path: dist-macos-3.11
- run: mv -v dist-macos-3.11/* dist/
- name: Stage macos 3.12
uses: actions/[email protected]
with:
name: dist-macos-3.12
path: dist-macos-3.12
- run: mv -v dist-macos-3.12/* dist/
- name: Stage windows 3.9
uses: actions/[email protected]
with:
name: dist-windows-3.9
path: dist-windows-3.9
- run: mv -v dist-windows-3.9/* dist/
- name: Stage windows 3.10
uses: actions/[email protected]
with:
name: dist-windows-3.10
path: dist-windows-3.10
- run: mv -v dist-windows-3.10/* dist/
- name: Stage windows 3.11
uses: actions/[email protected]
with:
name: dist-windows-3.11
path: dist-windows-3.11
- run: mv -v dist-windows-3.11/* dist/
- name: Stage windows 3.12
uses: actions/[email protected]
with:
name: dist-windows-3.12
path: dist-windows-3.12
- run: mv -v dist-windows-3.12/* dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: raspberrypi
env:
CIBW_BEFORE_ALL: "pip install --upgrade cython wheel numpy"
CIBW_SKIP: "*-musllinux*"
MACOSX_DEPLOYMENT_TARGET: "10.12"
MPL_DISABLE_FH4: "yes"
strategy:
matrix:
include:
- os: ubuntu-20.04
cibw_archs: "aarch64"
steps:
- name: Build wheels for CPython 3.11
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp311-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- name: Build wheels for CPython 3.10
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp310-*"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: wheelhouse