-
Notifications
You must be signed in to change notification settings - Fork 503
145 lines (122 loc) · 4.25 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
name: Wheels
on:
push:
tags:
- '*'
jobs:
build_source:
name: Build source package
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- 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@v3
with:
name: source
path: ./dist/*.tar.gz
build_python3_wheels:
name: Build Python 3 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v3
- name: Select architecture for MacOS
run: |
echo 'CIBW_ARCHS=x86_64 universal2' >> $GITHUB_ENV
if: runner.os == 'macOS'
- 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: "cp36-* 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_FREE_THREADED_SUPPORT: "true"
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_i686.whl
rm -f wheelhouse/*-manylinux1_x86_64.whl
- uses: actions/upload-artifact@v3
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-20.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-latest
arch: x86
- os: windows-latest
arch: x64
if: github.actor == 'Legrandin'
steps:
- uses: actions/checkout@v3
- 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@v3
with:
name: wheels
path: ./wheelhouse/*.whl