-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (209 loc) · 6.97 KB
/
manylinux_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
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
205
206
207
208
209
210
211
212
213
214
215
216
name: Manylinux wheels
on:
push:
pull_request:
create:
schedule:
- cron: '23 1 * * *'
env:
KIVY_SPLIT_EXAMPLES: 1
SERVER_IP: '159.203.106.198'
jobs:
kivy_examples_create:
# we need examples wheel for tests, but only windows actually uploads kivy-examples to pypi/server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
install_kivy_test_wheel_run_pip_deps
- name: Create wheel
run: |
source .ci/ubuntu_ci.sh
create_kivy_examples_wheel
- name: Upload kivy-examples wheel as artifact
uses: actions/upload-artifact@v3
with:
name: linux_examples_wheel
path: dist
manylinux_wheel_create:
env:
CIBW_ENVIRONMENT_LINUX: "KIVY_SPLIT_EXAMPLES=1 USE_X11=1 USE_SDL2=1 USE_PANGOFT2=0 USE_GSTREAMER=0 KIVY_DEPS_ROOT=$(pwd)/kivy-dependencies LD_LIBRARY_PATH=$(pwd)/kivy-dependencies/dist/lib:$(pwd)/kivy-dependencies/dist/lib64"
CIBW_BUILD_VERBOSITY_LINUX: 3
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BEFORE_ALL_LINUX: >
source .ci/ubuntu_ci.sh &&
install_manylinux_build_deps
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubuntu-latest
cibw_archs: x86_64
cibw_build: 'cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64'
- os: ubuntu-latest
cibw_archs: aarch64
cibw_build: 'cp37-manylinux_aarch64 cp38-manylinux_aarch64 cp39-manylinux_aarch64 cp310-manylinux_aarch64 cp311-manylinux_aarch64 cp312-manylinux_aarch64'
if: github.event_name == 'schedule' || (github.event_name == 'create' && github.event.ref_type == 'tag') || contains(github.event.head_commit.message, '[build wheel]') || contains(github.event.head_commit.message, '[build wheel linux]') || contains(github.event.pull_request.title, '[build wheel]') || contains(github.event.pull_request.title, '[build wheel linux]')
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Set up QEMU
if: ${{ matrix.cibw_archs == 'aarch64' }}
uses: docker/setup-qemu-action@v1
- uses: actions/cache@v3
id: deps-cache
with:
path: kivy-dependencies
key: ${{ runner.os }}-${{ matrix.cibw_archs }}-deps-cache-${{ hashFiles('./tools/build_linux_dependencies.sh') }}
- name: Build dependencies
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: |
docker run --rm -v `pwd`:/root:rw --workdir=/root \
quay.io/pypa/manylinux2014_${{ matrix.cibw_archs }} \
bash -ec 'source .ci/ubuntu_ci.sh && install_manylinux_build_deps && ./tools/build_linux_dependencies.sh'
- name: Generate version metadata
run: |
source .ci/ubuntu_ci.sh
update_version_metadata
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.16.2
- name: Make wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Upload wheels as artifact
uses: actions/upload-artifact@v3
with:
name: manylinux_wheels
path: ./wheelhouse/*.whl
manylinux_wheel_upload:
runs-on: ubuntu-latest
needs: [manylinux_wheel_create, kivy_examples_create]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/download-artifact@v3
with:
name: manylinux_wheels
path: dist
- name: Rename wheels
if: github.event.ref_type != 'tag'
run: |
source .ci/ubuntu_ci.sh
rename_wheels
- name: Upload wheels to server
env:
UBUNTU_UPLOAD_KEY: ${{ secrets.UBUNTU_UPLOAD_KEY }}
run: |
source .ci/ubuntu_ci.sh
upload_file_to_server "$SERVER_IP" "linux/kivy/"
- name: Upload to GitHub Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
draft: true
- name: Publish to PyPI
if: github.event_name == 'create' && github.event.ref_type == 'tag'
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
source .ci/ubuntu_ci.sh
upload_artifacts_to_pypi
manylinux_wheel_test:
runs-on: ubuntu-latest
needs: [manylinux_wheel_create, kivy_examples_create]
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12' ]
env:
DISPLAY: ':99.0'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v3
with:
name: manylinux_wheels
path: dist
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
prepare_env_for_unittest
- name: Install Kivy
run: |
source .ci/ubuntu_ci.sh
install_kivy_wheel dev
- uses: actions/download-artifact@v3
with:
name: linux_examples_wheel
path: dist
- name: Install kivy-examples wheel
run: |
source .ci/ubuntu_ci.sh
install_kivy_examples_wheel dev
- name: Test Kivy
run: |
source .ci/ubuntu_ci.sh
test_kivy_install
- name: Test Kivy benchmarks
if: matrix.python == '3.x' && (github.event_name == 'schedule' || (github.event_name == 'create' && github.event.ref_type == 'tag'))
run: |
source .ci/ubuntu_ci.sh
test_kivy_benchmark
- name: Upload benchmarks as artifact
uses: actions/upload-artifact@v3
with:
name: benchmarks
path: .benchmarks-kivy
sdist_test:
runs-on: ubuntu-latest
env:
DISPLAY: ':99.0'
KIVY_SPLIT_EXAMPLES: 0
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Generate sdist
run: |
source .ci/ubuntu_ci.sh
generate_sdist
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
install_ubuntu_build_deps
./tools/build_linux_dependencies.sh
install_kivy_test_wheel_run_pip_deps
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
prepare_env_for_unittest
- name: Install Kivy
run: |
source .ci/ubuntu_ci.sh
export KIVY_DEPS_ROOT=$(pwd)/kivy-dependencies
install_kivy_sdist
- name: Test Kivy
run: |
source .ci/ubuntu_ci.sh
test_kivy_install