-
Notifications
You must be signed in to change notification settings - Fork 522
232 lines (190 loc) · 7.13 KB
/
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: Wheels
on:
push:
tags:
- '*'
jobs:
build_source:
name: Build source package
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.x'
- name: Build source package (.tar.gz)
run: |
python -m pip install setuptools
python setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: source
path: ./dist/*.tar.gz
build_python3_wheels_linux_x86:
name: Build Python 3 wheels on Linux X86
runs-on: [ ubuntu-22.04 ]
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2014"
CIBW_ENABLE: cpython-freethreading
CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true"
# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"
- name: Delete manylinux1 wheels
run: |
rm -f wheelhouse/*-manylinux1_i686.whl
rm -f wheelhouse/*-manylinux1_x86_64.whl
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
build_python3_wheels_windows:
name: Build Python 3 wheels on Windows
runs-on: [ windows-2019 ]
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_ENABLE: cpython-freethreading
# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
build_python3_wheels_macos:
name: Build Python 3 wheels on MacOS
runs-on: [ macos-13 ]
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v4
- name: Select architecture for MacOS
run: |
echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV
- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_ENABLE: cpython-freethreading
# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
build_python3_wheels_linux_arm:
name: Build Python 3 wheels on Linux ARM
runs-on: [ ubuntu-22.04-arm ]
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v4
- uses: pypa/[email protected]
name: Build wheels
env:
# cibuildwheel will build wheel once and test it for each CPython version
# and for PyPy > 3.8.
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* pp39-* pp310-*"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: "manylinux2014"
CIBW_ENABLE: cpython-freethreading
CIBW_BEFORE_TEST_LINUX: "(ldd /bin/ls | grep -q musl && apk add gmp) || true"
# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"
- name: Delete manylinux1 wheels
if: runner.os == 'Linux'
run: |
rm -f wheelhouse/*-manylinux1_aarch64.whl
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
build_legacy_wheels:
name: Build legacy Python wheels on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, windows-2019, macos-12 ]
arch: [ multi-arch ]
# Python 2 on Windows requires manual toolchain setup (per-arch) due to newer MSVC used here
exclude:
- os: windows-2019
arch: multi-arch
include:
- os: windows-2019
arch: x86
- os: windows-2019
arch: x64
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v4
- name: Install MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.0
arch: ${{ matrix.arch }}
- name: Set Windows build environment variables
if: runner.os == 'Windows'
run: |
echo "DISTUTILS_USE_SDK=1" >> $env:GITHUB_ENV
echo "MSSdk=1" >> $env:GITHUB_ENV
if ( '${{ matrix.arch }}' -eq 'x86' )
{
echo "CIBW_ARCHS=x86" >> $env:GITHUB_ENV
}
else
{
echo "CIBW_ARCHS=AMD64" >> $env:GITHUB_ENV
}
- uses: pypa/[email protected]
name: Build wheels
env:
CIBW_BUILD: "cp27-* pp27-*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2010"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2010"
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "manylinux2010"
CIBW_MANYLINUX_PYPY_I686_IMAGE: "manylinux2010"
# Set pycryptodome/x test command according to built package
CIBW_TEST_COMMAND:
"${{ endsWith(github.ref, 'x') == true &&
'python -m Cryptodome.SelfTest --skip-slow-tests' ||
'python -m Crypto.SelfTest --skip-slow-tests' }}"
- name: Delete manylinux1 wheels
if: runner.os == 'Linux'
run: |
rm -f wheelhouse/*-manylinux1_i686.whl
rm -f wheelhouse/*-manylinux1_x86_64.whl
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl