-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (108 loc) · 3.64 KB
/
pythonpackage.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
name: Python package
on:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- .pre-commit-config.yaml
pull_request:
release:
types:
- published
jobs:
build_wheels_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: sh linux-build.sh
CIBW_BEFORE_BUILD: ls {project}/libjpeg-turbo-build
CIBW_SKIP: cp36-* pp*
CIBW_ARCHS_LINUX: auto64
CIBW_REPAIR_WHEEL_COMMAND: LD_LIBRARY_PATH=/project/libjpeg-turbo-build auditwheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_TEST: python -m pip install -r requirements-dev.txt && python generate_test_images.py
CIBW_TEST_COMMAND: cd {project} && python -m unittest discover -s tests
CIBW_TEST_SKIP: '*-musllinux_*'
CIBW_TEST_EXTRAS: test
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_wheels_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: sh macos-build.sh
CIBW_BEFORE_BUILD: ls {project}/libjpeg-turbo-build
CIBW_SKIP: cp36-* pp*
CIBW_REPAIR_WHEEL_COMMAND: DYLD_LIBRARY_PATH=./libjpeg-turbo-build delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_BEFORE_TEST: python -m pip install -r requirements-dev.txt && python generate_test_images.py
CIBW_TEST_COMMAND: cd {project} && python -m unittest discover -s tests
CIBW_TEST_EXTRAS: test
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_wheels_windows:
runs-on: windows-latest
strategy:
matrix:
arch:
- AMD64
- x86
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build dependencies
shell: cmd
run: |
python get-nasm.py ${{ matrix.arch }}
set path=%path%;%CD%\nasm-2.14.02
mkdir libjpeg-turbo-build
cd libjpeg-turbo-build
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ../libjpeg-turbo
nmake
cd ..
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: cp36-* pp*
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
CIBW_BEFORE_BUILD_WINDOWS: python -m pip install delvewheel
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: python -m delvewheel repair -w {dest_dir} {wheel} --add-path libjpeg-turbo-build --no-dll vcruntime140_1.dll;msvcp140.dll
CIBW_BEFORE_TEST: python -m pip install -r requirements-dev.txt && python generate_test_images.py
CIBW_TEST_COMMAND: cd /d {project} && python -m unittest discover -s tests
CIBW_TEST_SKIP: cp38-win32 cp39-win32 cp310-win32 cp311-win32 cp312-win32 # cp37-win32 has wheels!
CIBW_TEST_EXTRAS: test
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
upload-pypi:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}