37
37
mkdir -p dist/
38
38
echo "${VERSION}" > dist/VERSION
39
39
40
- - uses : actions/upload-artifact@v1
40
+ - uses : actions/upload-artifact@v2
41
41
with :
42
42
name : dist
43
43
path : dist/
@@ -47,172 +47,89 @@ jobs:
47
47
runs-on : ubuntu-latest
48
48
49
49
steps :
50
- - uses : actions/checkout@v1
50
+ - uses : actions/checkout@v2
51
51
with :
52
52
fetch-depth : 50
53
53
submodules : true
54
54
55
- - name : Set up Python 3.7
56
- uses : actions/setup-python@v1
57
- with :
58
- python-version : 3.7
55
+ - uses : actions/setup-python@v2
59
56
60
57
- name : Build source distribution
61
58
run : |
62
- pip install -U setuptools wheel pip
59
+ python -m pip install -U setuptools wheel pip
63
60
python setup.py sdist
64
61
65
- - uses : actions/upload-artifact@v1
62
+ - uses : actions/upload-artifact@v2
66
63
with :
67
64
name : dist
68
- path : dist/
65
+ path : dist/*.tar.*
69
66
70
67
build-wheels :
71
68
needs : validate-release-request
72
69
runs-on : ${{ matrix.os }}
73
70
strategy :
74
71
matrix :
75
- python-version : [3.7, 3.8, 3.9 ]
76
- os : [ubuntu-20.04, macos-latest ]
77
- arch : [x86_64, aarch64]
72
+ os : [ubuntu-latest, macos-latest ]
73
+ cibw_python : ["cp37-*", "cp38-*", "cp39-*", "cp310-*" ]
74
+ cibw_arch : [" x86_64", " aarch64", "universal2" ]
78
75
exclude :
76
+ - os : ubuntu-latest
77
+ cibw_arch : universal2
79
78
- os : macos-latest
80
- arch : aarch64
79
+ cibw_arch : aarch64
80
+ - os : macos-latest
81
+ cibw_python : " cp37-*"
82
+ cibw_arch : universal2
81
83
82
84
defaults :
83
85
run :
84
86
shell : bash
85
87
86
88
steps :
87
- - uses : actions/checkout@v1
89
+ - uses : actions/checkout@v2
88
90
with :
89
91
fetch-depth : 50
90
92
submodules : true
91
93
92
- - uses : actions/download-artifact@v1
93
- with :
94
- name : dist
95
- path : dist/
96
-
97
- - name : Extract Release Version
98
- id : relver
99
- run : |
100
- set -e
101
- echo ::set-output name=version::$(cat dist/VERSION)
102
- rm dist/*
103
-
104
94
- name : Set up QEMU
105
- if : matrix.arch == 'aarch64'
95
+ if : matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64'
106
96
uses : docker/setup-qemu-action@v1
107
-
108
- - name : Set up Python ${{ matrix.python-version }}
109
- uses : actions/setup-python@v1
110
97
with :
111
- python-version : ${{ matrix.python-version }}
112
-
113
- - name : Install Python deps
114
- run : |
115
- python -m pip install --upgrade setuptools pip wheel
98
+ platforms : arm64
116
99
117
100
- name : Install macOS deps
118
101
if : startsWith(matrix.os, 'macos')
119
102
run : |
120
103
brew install gnu-sed libtool autoconf automake
121
104
122
- - name : Build Wheels (linux)
123
- if : startsWith(matrix.os, 'ubuntu')
124
- env :
125
- PYTHON_VERSION : ${{ matrix.python-version }}
126
- ARCH : ${{ matrix.arch }}
127
- run : |
128
- case "${ARCH}" in
129
- x86_64)
130
- mlimg=manylinux2010_x86_64
131
- ;;
132
- aarch64)
133
- mlimg=manylinux2014_aarch64
134
- ;;
135
- *)
136
- echo "Unsupported wheel arch: ${ARCH}" >&2
137
- exit 1
138
- ;;
139
- esac
140
-
141
- docker run --rm \
142
- -v "${GITHUB_WORKSPACE}":/github/workspace:rw \
143
- --workdir=/github/workspace \
144
- -e GITHUB_WORKSPACE=/github/workspace \
145
- -e PYTHON_VERSION="${PYTHON_VERSION}" \
146
- --entrypoint=/github/workspace/.github/workflows/build-manylinux-wheels.sh \
147
- quay.io/pypa/${mlimg}
148
-
149
- - name : Build Wheels (non-linux)
150
- if : " !startsWith(matrix.os, 'ubuntu')"
151
- run : |
152
- make clean
153
- python setup.py bdist_wheel
154
-
155
- - name : Test Wheels (native)
156
- timeout-minutes : 10
157
- if : |
158
- !contains(github.event.pull_request.labels.*.name, 'skip wheel tests')
159
- && matrix.arch == 'x86_64'
105
+
160
106
env :
161
- OS : ${{ matrix.os }}
162
- PKG_VERSION : ${{ steps.relver.outputs.version }}
163
- run : |
164
- "${GITHUB_WORKSPACE}/.github/workflows/test-wheels.sh"
165
-
166
- - name : Test Wheels (emulated)
167
- timeout-minutes : 30
168
- if : |
169
- !contains(github.event.pull_request.labels.*.name, 'skip wheel tests')
170
- && matrix.arch != 'x86_64'
171
- env :
172
- PYTHON_VERSION : ${{ matrix.python-version }}
173
- ARCH : ${{ matrix.arch }}
174
- PKG_VERSION : ${{ steps.relver.outputs.version }}
175
- run : |
176
- case "${ARCH}" in
177
- aarch64)
178
- img="docker.io/arm64v8/python:${PYTHON_VERSION}-buster"
179
- ;;
180
- *)
181
- echo "Unsupported wheel arch: ${ARCH}" >&2
182
- exit 1
183
- ;;
184
- esac
185
-
186
- docker run --rm \
187
- -v "${GITHUB_WORKSPACE}":/github/workspace:rw \
188
- -e GITHUB_WORKSPACE=/github/workspace \
189
- -e PKG_VERSION="${PKG_VERSION}" \
190
- --workdir=/github/workspace/ \
191
- ${img} \
192
- /bin/bash -ex -c ' \
193
- echo GITHUB_WORKSPACE=${GITHUB_WORKSPACE} >> /etc/environment \
194
- && echo PKG_VERSION=${PKG_VERSION} >> /etc/environment \
195
- && echo ENVIRON_FILE /etc/environment >> /etc/login.defs \
196
- && useradd -m -s /bin/bash test \
197
- && su -l test /github/workspace/.github/workflows/test-wheels.sh \
198
- '
199
-
200
- - uses : actions/upload-artifact@v1
107
+ CIBW_BUILD_VERBOSITY : 1
108
+ CIBW_BUILD : ${{ matrix.cibw_python }}
109
+ CIBW_ARCHS : ${{ matrix.cibw_arch }}
110
+ CIBW_TEST_EXTRAS : " test"
111
+ CIBW_TEST_COMMAND : " cd .. && python {project}/tests/__init__.py"
112
+ CIBW_TEST_COMMAND_WINDOWS : " cd .. && python {project}\\ tests\\ __init__.py"
113
+ CIBW_TEST_SKIP : " *universal2:arm64"
114
+ # This is needed for now because cffi has no cp310 wheels
115
+ CIBW_BEFORE_BUILD_LINUX : " yum -y install libffi-devel"
116
+
117
+ - uses : actions/upload-artifact@v2
201
118
with :
202
119
name : dist
203
- path : dist/
120
+ path : wheelhouse/*.whl
204
121
205
122
publish :
206
123
needs : [build-sdist, build-wheels]
207
124
runs-on : ubuntu-latest
208
125
209
126
steps :
210
- - uses : actions/checkout@v1
127
+ - uses : actions/checkout@v2
211
128
with :
212
129
fetch-depth : 5
213
130
submodules : false
214
131
215
- - uses : actions/download-artifact@v1
132
+ - uses : actions/download-artifact@v2
216
133
with :
217
134
name : dist
218
135
path : dist/
0 commit comments