-
Notifications
You must be signed in to change notification settings - Fork 17
204 lines (175 loc) · 6.54 KB
/
build-cache-deps.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
name: Build Linux dependencies
on:
push:
branches: [master]
paths:
- '.github/workflows/build-cache-deps.yml'
- 'docker/*_armv7l_wheels.Dockerfile'
- 'libheif/linux/**'
- 'libheif/linux_*.py'
- 'setup.py'
schedule:
- cron: '59 23 * * 5' # Every Friday at 23:59 (GMT+2)
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dependencies_linux:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux, musllinux ]
cibw_arch: [ "aarch64", "x86_64" ]
name: ${{ matrix.cibw_arch }} • ${{ matrix.cibw_buildlinux }}
runs-on: ubuntu-20.04
env:
KEY_HEAD: ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
BUILD_DIR: "/tmp/ph_build_stuff"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Install cibuildwheel & twine
run: python3 -m pip install twine cibuildwheel==2.15.0
- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}
- name: Start test build
run: cibuildwheel
env:
CIBW_BUILD: ${{ format('cp38-{0}*', matrix.cibw_buildlinux) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_FULL_ACTION=1
CIBW_TEST_COMMAND: "python3 -c 'import pillow_heif; print(pillow_heif.libheif_info())'"
CIBW_TEST_EXTRAS: ""
CIBW_BUILD_VERBOSITY: 1
- name: Checking built wheels
run: twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse/*.whl
if-no-files-found: error
- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}
pi_heif_dependencies_linux:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux, musllinux ]
cibw_arch: [ "aarch64", "i686", "x86_64" ]
name: Pi-Heif • ${{ matrix.cibw_arch }} • ${{ matrix.cibw_buildlinux }}
runs-on: ubuntu-20.04
env:
KEY_HEAD: Pi-Heif-${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
BUILD_DIR: "/tmp/ph_build_stuff"
steps:
- uses: actions/checkout@v4
- name: Transform to Pi-Heif
run: |
cp -r -v ./pi-heif/* .
python3 .github/transform_to-pi_heif.py
- name: Set up QEMU
if: matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Install cibuildwheel & twine
run: python3 -m pip install twine cibuildwheel==2.15.0
- name: 32-bit musllinux preparations
if: matrix.cibw_buildlinux == 'musllinux' && matrix.cibw_arch == 'i686'
run: echo INSTALL_OS_PACKAGES="apk update && apk --no-cache add $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"
- name: 32-bit manylinux preparations
if: matrix.cibw_buildlinux == 'manylinux' && matrix.cibw_arch == 'i686'
run: echo INSTALL_OS_PACKAGES="yum makecache && yum install -y $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "libjpeg-turbo-devel lcms2-devel"
- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}
- name: Start test build
run: cibuildwheel
env:
CIBW_BUILD: ${{ format('cp38-{0}*', matrix.cibw_buildlinux) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: ${{ env.INSTALL_OS_PACKAGES }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR=/host${{ env.BUILD_DIR }} PH_LIGHT_ACTION=1
CIBW_TEST_COMMAND: "python3 -c 'import pi_heif; print(pi_heif.libheif_info())'"
CIBW_TEST_EXTRAS: ""
CIBW_BUILD_VERBOSITY: 1
- name: Checking built wheels
run: twine check wheelhouse/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse/*.whl
if-no-files-found: error
- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}
pi_heif_dependencies_linux_armv7:
strategy:
fail-fast: true
matrix:
i: [
{ "docker_file": "manylinux_armv7l_wheels", "name": "manylinux" },
{ "docker_file": "musllinux_armv7l_wheels", "name": "musllinux" },
]
v: ["3.10"]
name: Pi-Heif • ARMv7l • ${{ matrix.i['name'] }}
runs-on: ubuntu-20.04
env:
KEY_HEAD: Pi-Heif-ARMv7l-${{ matrix.i['name'] }}
BUILD_DIR: "./build_cache"
steps:
- uses: actions/checkout@v4
- name: Transform to Pi-Heif
run: |
cp -r -v ./pi-heif/* .
python3 .github/transform_to-pi_heif.py
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
key: ${{ env.KEY_HEAD }}-${{ env.KEY_C_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux/**') }}
KEY_C_BUILD: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/setup.py') }}
- name: Build Pi-Heif
uses: docker/build-push-action@v5
with:
context: .
file: docker/${{ matrix.i['docker_file'] }}.Dockerfile
build-args: |
PY_VERSION=${{ matrix.v }}
platforms: linux/arm/v7
push: false
outputs: type=local,dest=./
- name: Checking built wheels
run: |
python3 -m pip install twine
python3 -m twine check ./repaired_dist/*
- name: Uploading wheels
uses: actions/upload-artifact@v3
with:
name: wheels_pi_heif
path: ./repaired_dist/*.whl
if-no-files-found: error
- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR }}