55 workflow_dispatch :
66
77jobs :
8- # wheels_windows:
9- # strategy:
10- # fail-fast: true
11- # matrix:
12- # include:
13- # - runs-on: windows-latest
14- # cibw-arch: AMD64
15- # name: Wheels • ${{ matrix.cibw-arch }}
16- # runs-on: ${{ matrix.runs-on }}
17- #
18- # steps:
19- # - name: Checkout code
20- # uses: actions/checkout@v2
21- # with:
22- # submodules: recursive
23- #
24- # - name: Setup Python
25- # uses: actions/setup-python@v2
26- # with:
27- # python-version: '3.8'
28- # architecture: ${{ matrix.python-arch }}
29- #
30- # - name: Install requirements
31- # run: |
32- # python -m pip install cibuildwheel twine
33- #
34- # - name: macOS x64 pre configure enviroment
35- # if: matrix.cibw-arch == 'AMD64'
36- # shell: cmd
37- # run: |
38- # echo "CIBW_ARCHS_WINDOWS=AMD64" >> $GITHUB_ENV
39- #
40- # - name: Configure cibuildwheel
41- # shell: cmd
42- # run: |
43- # echo "CIBW_BUILD=*-${{ matrix.cibw-arch }}" >> $GITHUB_ENV
44- # echo "CIBW_SKIP=pp*" >> $GITHUB_ENV
45- # echo "CIBW_TEST_REQUIRES=pytest piexif" >> $GITHUB_ENV
46- # echo "CIBW_TEST_COMMAND=pytest {project}" >> $GITHUB_ENV
47- #
48- # - name: Run cibuildwheel
49- # run: |
50- # cibuildwheel
51- #
52- # - name: Check built wheels
53- # run: |
54- # twine check wheelhouse/*
55- #
56- # - name: Upload built wheels
57- # uses: actions/upload-artifact@v2
58- # with:
59- # name: wheels
60- # path: wheelhouse/*.whl
61- # if-no-files-found: error
62- #
63- wheels_macos :
64- strategy :
65- fail-fast : true
66- matrix :
67- include :
68- - runs-on : macos-11
69- cibw-arch : macosx_x86_64
70- name : Wheels • ${{ matrix.cibw-arch }}
71- runs-on : ${{ matrix.runs-on }}
8+ wheels_windows :
9+ name : Wheels • windows • x86_64
10+ runs-on : windows-2019
11+ env :
12+ VCPKG_PREFIX : " C:/vcpkg/installed/x64-windows"
7213
7314 steps :
74- - name : Checkout code
75- uses : actions/checkout@v2
76- with :
77- submodules : recursive
15+ - uses : actions/checkout@v2
16+ - name : Install requirements and dependencies
17+ run : |
18+ python3 -m pip install cibuildwheel twine
19+ vcpkg install aom libheif --triplet=x64-windows
7820
79- - name : Setup Python
80- uses : actions/setup-python@v2
21+ - name : Run cibuildwheel
22+ run : cibuildwheel
23+ env :
24+ CIBW_BUILD : " cp37-* cp38-* cp39-* cp310-*"
25+ CIBW_ARCHS_WINDOWS : " AMD64"
26+ CIBW_BUILD_VERBOSITY : 1
27+ CIBW_BEFORE_BUILD_WINDOWS : " pip install delvewheel"
28+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS : " delvewheel repair -v -w {dest_dir} {wheel} --add-path ${{ env.VCPKG_PREFIX }}/bin"
29+ CIBW_BEFORE_TEST : pip install -r requirements_dev.txt
30+ CIBW_TEST_COMMAND_WINDOWS : " pytest -s {project}"
31+
32+ - name : Check built wheels
33+ run : twine check wheelhouse/*
34+
35+ - name : Upload built wheels
36+ uses : actions/upload-artifact@v2
8137 with :
82- python-version : ' 3.8'
83- architecture : ${{ matrix.python-arch }}
38+ name : wheels
39+ path : wheelhouse/*.whl
40+ if-no-files-found : error
8441
85- - name : macOS x64 pre configure enviroment
86- if : matrix.cibw-arch == 'macosx_x86_64'
87- run : |
88- echo "CIBW_ARCHS_MACOS=x86_64" >> $GITHUB_ENV
42+ wheels_macos :
43+ name : Wheels • macosx • x86_64
44+ runs-on : macos-11
8945
46+ steps :
47+ - uses : actions/checkout@v2
9048 - name : Run cibuildwheel
9149 run : |
9250 python3 -m pip install cibuildwheel twine
9351 cibuildwheel
9452 env :
95- CIBW_BUILD : ${{ format('*-{0}', matrix.cibw-arch) }}
53+ CIBW_BEFORE_BUILD_MACOS : >
54+ brew install x265 libjpeg libde265 libheif &&
55+ HOMEBREW_PREFIX=$(brew --prefix) &&
56+ REPAIR_LIBRARY_PATH=$HOMEBREW_PREFIX/lib
57+ CIBW_BUILD : " *-macosx_x86_64"
9658 CIBW_SKIP : " pp* cp36-*"
97- CIBW_TEST_COMMAND : " pytest {project}"
98- CIBW_TEST_REQUIRES : " pytest piexif"
59+ CIBW_REPAIR_WHEEL_COMMAND_MACOS : >
60+ DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-listdeps {wheel} &&
61+ DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel -v --require-archs {delocate_archs} -w {dest_dir} {wheel}
62+ CIBW_BEFORE_TEST : pip3 install -r requirements_dev.txt
63+ CIBW_TEST_COMMAND : " pytest -s {project}"
9964 CIBW_BUILD_VERBOSITY : 1
10065
10166 - name : Check built wheels
102- run : |
103- twine check wheelhouse/*
67+ run : twine check wheelhouse/*
10468
10569 - name : Upload built wheels
10670 uses : actions/upload-artifact@v2
@@ -113,52 +77,44 @@ jobs:
11377 strategy :
11478 fail-fast : true
11579 matrix :
116- include :
117- - runs-on : ubuntu-latest
118- cibw-arch : manylinux_x86_64
119- many-linux : manylinux2014
120- - runs-on : ubuntu-latest
121- cibw-arch : manylinux_aarch64
122- many-linux : manylinux2014
123- - runs-on : ubuntu-latest
124- cibw-arch : manylinux_x86_64
125- many-linux : musllinux_1_1
126- - runs-on : ubuntu-latest
127- cibw-arch : manylinux_aarch64
128- many-linux : musllinux_1_1
129- name : Wheels • ${{ matrix.cibw-arch }} • ${{ matrix.many-linux }}
130- runs-on : ${{ matrix.runs-on }}
80+ cibw_buildlinux : [ manylinux, musllinux ]
81+ cibw_arch : [ "x86_64", "aarch64" ]
82+ name : Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }}
83+ runs-on : ubuntu-20.04
13184 env :
13285 BUILD_STUFF : " /build-stuff"
13386 SCRIPTS : " ./build_scripts/linux/"
134- KEY_HEAD : ${{ matrix.runs-on }}-${{ matrix.cibw-arch }}-${{ matrix.many-linux }}
87+ BUILD_ORDER : " pkg-config,nasm,libde265,aom,libheif,libffi"
88+ KEY_HEAD : ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
13589
13690 steps :
137- - name : Checkout code
138- uses : actions/checkout@v2
91+ - uses : actions/checkout@v2
92+ - name : Set up QEMU
93+ if : matrix.cibw_arch == 'aarch64'
94+ uses : docker/setup-qemu-action@v1
13995 with :
140- submodules : recursive
96+ platforms : arm64
14197
142- - name : manylinux2014 preparations
143- if : matrix.many-linux == 'manylinux2014'
98+ - name : Preparations
14499 run : |
145100 sudo mkdir "$BUILD_STUFF" && sudo chmod 777 "$BUILD_STUFF"
146- BUILD_STUFF_CMD="&& sh $(echo "$BUILD_ORDER" | sed 's/,/.sh \&\& sh /g').sh"
101+ echo BUILD_STUFF_CMD="&& sh $(echo "$BUILD_ORDER" | sed 's/,/.sh \&\& sh /g').sh" >> $GITHUB_ENV
102+ python3 -m pip install cibuildwheel twine
103+
104+ - name : manylinux preparations
105+ if : matrix.cibw_buildlinux == 'manylinux'
106+ run : |
147107 echo BUILD_COMMAND="yum install -y -q $OS_PACKAGES && set -ex && cd $SCRIPTS $BUILD_STUFF_CMD" >> $GITHUB_ENV
148108 echo LDCONFIG_ARG="" >> $GITHUB_ENV
149109 env :
150- BUILD_ORDER : " pkg-config,nasm,libde265,aom,libheif,libffi"
151110 OS_PACKAGES : " wget libtool git-all"
152111
153- - name : musllinux_1_1 preparations
154- if : matrix.many-linux == 'musllinux_1_1 '
112+ - name : musllinux preparations
113+ if : matrix.cibw_buildlinux == 'musllinux '
155114 run : |
156- sudo mkdir "$BUILD_STUFF" && sudo chmod 777 "$BUILD_STUFF"
157- BUILD_STUFF_CMD="&& sh $(echo "$BUILD_ORDER" | sed 's/,/.sh \&\& sh /g').sh"
158115 echo BUILD_COMMAND="apk --no-cache add -q $OS_PACKAGES && set -ex && cd $SCRIPTS $BUILD_STUFF_CMD" >> $GITHUB_ENV
159116 echo LDCONFIG_ARG="/usr/lib" >> $GITHUB_ENV
160117 env :
161- BUILD_ORDER : " nasm,aom,libffi,pkg-config,libde265,libheif"
162118 OS_PACKAGES : " sudo py3-pip python3-dev libtool git \
163119 freetype-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev tiff-dev zlib-dev"
164120
@@ -169,34 +125,6 @@ jobs:
169125 env :
170126 NAME : pkg-config
171127
172- # - uses: actions/cache@v2
173- # with:
174- # path: ${{ env.BUILD_STUFF }}/${{ env.NAME }}
175- # key: ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
176- # env:
177- # NAME: cmake
178-
179- # - uses: actions/cache@v2
180- # with:
181- # path: ${{ env.BUILD_STUFF }}/${{ env.NAME }}
182- # key: ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
183- # env:
184- # NAME: autoconf
185-
186- # - uses: actions/cache@v2
187- # with:
188- # path: ${{ env.BUILD_STUFF }}/${{ env.NAME }}
189- # key: ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
190- # env:
191- # NAME: automake
192-
193- # - uses: actions/cache@v2
194- # with:
195- # path: ${{ env.BUILD_STUFF }}/${{ env.NAME }}
196- # key: ${{ env.KEY_HEAD }}-${{ hashFiles(format('{0}{1}.sh', env.SCRIPTS, env.NAME)) }}
197- # env:
198- # NAME: libressl
199-
200128 - uses : actions/cache@v2
201129 with :
202130 path : ${{ env.BUILD_STUFF }}/${{ env.NAME }}
@@ -232,40 +160,19 @@ jobs:
232160 env :
233161 NAME : libffi
234162
235- - name : Set up QEMU
236- if : matrix.cibw-arch == 'manylinux_aarch64'
237- uses : docker/setup-qemu-action@v1
238- with :
239- platforms : arm64
240-
241- - name : x64 linux pre configure enviroment
242- if : matrix.cibw-arch == 'manylinux_x86_64'
243- run : |
244- echo "CIBW_ARCHS=x86_64" >> $GITHUB_ENV
245-
246- - name : Arm linux pre configure enviroment
247- if : matrix.cibw-arch == 'manylinux_aarch64'
248- run : |
249- echo "CIBW_ARCHS=aarch64" >> $GITHUB_ENV
250-
251163 - name : Run cibuildwheel
252- run : |
253- python -m pip install cibuildwheel twine
254- cibuildwheel
164+ run : cibuildwheel
255165 env :
256- CIBW_BEFORE_ALL : ${{ env.BUILD_COMMAND }}
257- CIBW_ENVIRONMENT : BUILD_STUFF=${{ env.BUILD_STUFF }} LDCONFIG_ARG=${{ env.LDCONFIG_ARG }}
258- CIBW_BUILD : ${{ format('*-{0}', matrix.cibw-arch) }}
259- CIBW_SKIP : " pp* cp36-*"
260- CIBW_TEST_COMMAND : " pytest {project}"
261- CIBW_TEST_REQUIRES : " pytest piexif"
262- CIBW_BUILD_VERBOSITY : 1
263- CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.many-linux }}
264- CIBW_MANYLINUX_AARCH64_IMAGE : ${{ matrix.many-linux }}
166+ CIBW_BUILD : ${{ format('cp3*-{0}*', matrix.cibw_buildlinux) }}
167+ CIBW_SKIP : " cp36-*"
168+ CIBW_ARCHS : ${{ matrix.cibw_arch }}
169+ CIBW_BEFORE_BUILD_LINUX : ${{ env.BUILD_COMMAND }}
170+ CIBW_ENVIRONMENT_PASS_LINUX : BUILD_STUFF LDCONFIG_ARG
171+ CIBW_BEFORE_TEST : pip3 install -r requirements_dev.txt
172+ CIBW_TEST_COMMAND : " pytest -s {project}"
265173
266174 - name : Check builded wheels
267- run : |
268- twine check wheelhouse/*
175+ run : twine check wheelhouse/*
269176
270177 - name : Upload builded wheels
271178 uses : actions/upload-artifact@v2
@@ -276,45 +183,31 @@ jobs:
276183
277184 sdist :
278185 name : Source distribution
279- runs-on : macos-latest
186+ runs-on : macos-11
280187
281188 steps :
282- - name : Checkout code
283- uses : actions/checkout@v2
284- with :
285- submodules : recursive
286-
287- - name : Setup Python
288- uses : actions/setup-python@v2
289- with :
290- python-version : ' 3.8'
291-
189+ - uses : actions/checkout@v2
292190 - name : Install requirements
293- run : |
294- pip3 install --user check-manifest twine
191+ run : pip3 install --user check-manifest twine
192+
193+ - name : Run check-manifest
194+ run : python3 -m check_manifest
295195
296196 - name : Install brew
297197 run : |
298198 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
299199 brew install libffi libheif
300200
301- - name : Run check-manifest
302- run : |
303- python3 -m check_manifest
304-
305201 - name : Build sdist
306202 run : |
307203 python3 -m pip install --upgrade pip setuptools wheel
308204 python3 -m pip install -r requirements.txt
309205 python3 -m pip install -r requirements_dev.txt
310206 python3 -m build --sdist --outdir wheelhouse
311207
312- - name : Install from sdist
208+ - name : Install and check sdist
313209 run : |
314210 pip3 install --user wheelhouse/*.tar.gz
315-
316- - name : Check sdist
317- run : |
318211 python3 -m twine check wheelhouse/*
319212
320213 - name : Upload sdist
@@ -325,13 +218,11 @@ jobs:
325218
326219 draft_release :
327220 needs : [sdist, wheels_linux, wheels_macos]
328- runs-on : ubuntu-latest
221+ runs-on : ubuntu-20.04
329222 name : Build and create release
330223
331224 steps :
332- - name : Checkout
333- uses : actions/checkout@v2
334-
225+ - uses : actions/checkout@v2
335226 - name : Get release info
336227 id : get_release_info
337228 run : |
0 commit comments