-
-
Notifications
You must be signed in to change notification settings - Fork 16
255 lines (222 loc) · 7.17 KB
/
Android-Qt5.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: Android Qt5 CI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '**'
paths-ignore:
- ".gitignore"
- "README.md"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/Android-Qt6.yml"
- ".github/workflows/iOS-Qt5.yml"
- ".github/workflows/iOS-Qt6.yml"
- ".github/workflows/Linux-Qt5.yml"
- ".github/workflows/Linux-Qt6.yml"
- ".github/workflows/macOS-Qt5.yml"
- ".github/workflows/macOS-Qt6.yml"
- ".github/workflows/Windows-Qt5.yml"
- ".github/workflows/Windows-Qt6.yml"
pull_request:
branches:
- main
paths-ignore:
- ".gitignore"
- "README.md"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/Android-Qt6.yml"
- ".github/workflows/iOS-Qt5.yml"
- ".github/workflows/iOS-Qt6.yml"
- ".github/workflows/Linux-Qt5.yml"
- ".github/workflows/Linux-Qt6.yml"
- ".github/workflows/macOS-Qt5.yml"
- ".github/workflows/macOS-Qt6.yml"
- ".github/workflows/Windows-Qt5.yml"
- ".github/workflows/Windows-Qt6.yml"
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
QT_VERSION: 5.15.2
jobs:
build-core:
name: "Build maplibre-gl-native for ${{ matrix.config.abi }}"
runs-on: ubuntu-22.04
strategy:
matrix:
config:
- abi: x86
- abi: x86_64
- abi: armeabi-v7a
- abi: arm64-v8a
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: source
submodules: recursive
fetch-depth: 0
- name: Download Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: ==3.0.*
version: ${{ env.QT_VERSION }}
target: 'android'
arch: 'android'
- name: Set up OpenJDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: Android_maplibre-gl-native_${{ matrix.config.abi }}_legacy
append-timestamp: false
- name: Build maplibre-gl-native
env:
ANDROID_ABI: ${{ matrix.config.abi }}
run: |
mkdir build && cd build
cmake ../source/dependencies/maplibre-gl-native \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI="${ANDROID_ABI}" \
-DANDROID_CCACHE=ccache \
-DANDROID_NATIVE_API_LEVEL=21 \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS_RELEASE=-g0 \
-DCMAKE_FIND_ROOT_PATH="${Qt5_Dir}" \
-DCMAKE_INSTALL_PREFIX=../install-qmaplibregl \
-DCMAKE_PREFIX_PATH="${Qt5_Dir}" \
-DMBGL_WITH_QT=ON \
-DMBGL_QT_LIBRARY_ONLY=ON \
-DMBGL_QT_STATIC=ON
ninja
ninja install
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: maplibre-gl-native_Android_${{ matrix.config.abi }}
path: install-qmaplibregl
prepare-core:
name: "Prepare maplibre-gl-native"
runs-on: ubuntu-22.04
needs: build-core
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: maplibre-gl-native_Android_x86
path: install-x86
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: maplibre-gl-native_Android_x86_64
path: install-x86_64
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: maplibre-gl-native_Android_armeabi-v7a
path: install-armeabi-v7a
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: maplibre-gl-native_Android_arm64-v8a
path: install-arm64-v8a
- name: Prepare artifacts
run: |
cp -r install-arm64-v8a install-qmaplibregl
cp -r install-armeabi-v7a/lib/* install-qmaplibregl/lib/
cp -r install-x86/lib/* install-qmaplibregl/lib/
cp -r install-x86_64/lib/* install-qmaplibregl/lib/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: maplibre-gl-native_Android
path: install-qmaplibregl
build-plugin:
name: "Build qt-geoservices-maplibre-gl"
runs-on: ubuntu-22.04
needs: prepare-core
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: source
fetch-depth: 0
- name: Download Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: ==3.0.*
version: ${{ env.QT_VERSION }}
target: android
arch: 'android'
- name: Set up OpenJDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: Android_qt-geoservices-maplibre-gl_legacy
append-timestamp: false
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: maplibre-gl-native_Android
path: install-qmaplibregl
- name: Build qt-geoservices-maplibre-gl
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
mkdir build && cd build
qmake ../source/ QMAPLIBREGL_PATH=../install-qmaplibregl
make -j2
INSTALL_ROOT=../install make install
- name: Create artifacts
run: |
pushd install/home/runner/work/maplibre-native-qt
tar cjvf ../../../../../qt-geoservices-maplibre-gl_Android.tar.bz2 Qt
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: qt-geoservices-maplibre-gl_Android
path: qt-geoservices-maplibre-gl_Android.tar.bz2
release:
name: "Release qt-geoservices-maplibre-gl"
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
needs: build-plugin
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: qt-geoservices-maplibre-gl_Android
- name: Name tarball
env:
TAG_NAME: ${{ github.ref_name }}
run: |
mv qt-geoservices-maplibre-gl_Android.tar.bz2 qt-geoservices-maplibre-gl_${TAG_NAME}_Qt${QT_VERSION}_Android.tar.bz2
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: qt-geoservices-maplibre-gl_${{ github.ref_name }}_Qt${{ env.QT_VERSION }}_Android.tar.bz2
allowUpdates: true
draft: true