-
-
Notifications
You must be signed in to change notification settings - Fork 16
238 lines (208 loc) · 6.49 KB
/
Android.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
name: Android CI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "**"
paths-ignore:
- ".gitignore"
- "README.md"
- "docs/**"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/iOS.yml"
- ".github/workflows/Linux.yml"
- ".github/workflows/macOS.yml"
- ".github/workflows/Windows.yml"
pull_request:
branches:
- main
paths-ignore:
- ".gitignore"
- "README.md"
- "docs/**"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/iOS.yml"
- ".github/workflows/Linux.yml"
- ".github/workflows/macOS.yml"
- ".github/workflows/Windows.yml"
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
name: Build (Qt${{ matrix.qt_version}}, ${{ matrix.abi }})
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- qt_version: 6.5.3
abi: x86
arch: android_x86
- qt_version: 6.5.3
abi: x86_64
arch: android_x86_64
- qt_version: 6.5.3
abi: armeabi-v7a
arch: android_armv7
- qt_version: 6.5.3
abi: arm64-v8a
arch: android_arm64_v8a
- qt_version: 6.6.3
abi: x86
arch: android_x86
- qt_version: 6.6.3
abi: x86_64
arch: android_x86_64
- qt_version: 6.6.3
abi: armeabi-v7a
arch: android_armv7
- qt_version: 6.6.3
abi: arm64-v8a
arch: android_arm64_v8a
- qt_version: 6.7.3
abi: x86
arch: android_x86
- qt_version: 6.7.3
abi: x86_64
arch: android_x86_64
- qt_version: 6.7.3
abi: armeabi-v7a
arch: android_armv7
- qt_version: 6.7.3
abi: arm64-v8a
arch: android_arm64_v8a
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: source
submodules: recursive
fetch-depth: 0
- name: Download Qt
id: qt-android
uses: jurplel/install-qt-action@v4
with:
aqtversion: ==3.1.*
version: ${{ matrix.qt_version }}
target: android
arch: ${{ matrix.arch }}
modules: qtlocation qtpositioning
- name: Fix Qt release
if: ${{ matrix.abi }} == 'armeabi-v7a'
run: |
chmod +x "$QT_ROOT_DIR/bin/qt-cmake"
sed -i "s/C:\/Qt\/Qt-${QT_VERSION}/\/usr\/local\/Qt-${QT_VERSION}/g" "$QT_ROOT_DIR/lib/cmake/Qt6BuildInternals/QtBuildInternalsExtra.cmake"
- name: Set up OpenJDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: Android_${{ matrix.qt_version }}_${{ matrix.abi }}
max-size: 200M
- name: Build
env:
ANDROID_ABI: ${{ matrix.abi }}
working-directory: source
run: |
export QT_HOST_PATH="$(readlink -f "$QT_ROOT_DIR/../gcc_64")"
cmake --workflow --preset Android-ccache
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Android_${{ matrix.qt_version }}_${{ matrix.abi }}
path: build/qt6-Android/maplibre-native-qt_*_Android.tar.bz2
combine:
name: Combine
runs-on: ubuntu-24.04
needs: build
strategy:
matrix:
qt_version: [6.5.3, 6.6.3, 6.7.3]
steps:
- name: Download artifacts for x86
uses: actions/download-artifact@v4
with:
name: Android_${{ matrix.qt_version}}_x86
path: install/x86
- name: Download artifacts for x86_64
uses: actions/download-artifact@v4
with:
name: Android_${{ matrix.qt_version}}_x86_64
path: install/x86_64
- name: Download artifacts for armeabi-v7a
uses: actions/download-artifact@v4
with:
name: Android_${{ matrix.qt_version}}_armeabi-v7a
path: install/armeabi-v7a
- name: Download artifacts for arm64-v8a
uses: actions/download-artifact@v4
with:
name: Android_${{ matrix.qt_version}}_arm64-v8a
path: install/arm64-v8a
- name: Combine artifacts
run: |
pushd install
tar xf x86/*.tar.bz2 -C x86/
rm x86/*.tar.bz2
mv x86/maplibre-native-qt_*/* x86/
mv x86/maplibre-native-qt_*/ .
tar xf x86_64/*.tar.bz2 -C x86_64/
mv x86_64/maplibre-native-qt_*/* x86_64/
rm -r x86_64/maplibre-native-qt_*
tar xf armeabi-v7a/*.tar.bz2 -C armeabi-v7a/
mv armeabi-v7a/maplibre-native-qt_*/* armeabi-v7a/
rm -r armeabi-v7a/maplibre-native-qt_*
tar xf arm64-v8a/*.tar.bz2 -C arm64-v8a/
mv arm64-v8a/maplibre-native-qt_*/* arm64-v8a/
rm -r arm64-v8a/maplibre-native-qt_*
mv x86 x86_64 armeabi-v7a arm64-v8a maplibre-native-qt_*
popd
- name: Create artifacts
run: |
pushd install
tar cjvf ../maplibre-native-qt_Android.tar.bz2 *
popd
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Android_${{ matrix.qt_version}}
path: maplibre-native-qt_Android.tar.bz2
release:
name: Release
if: github.ref_type == 'tag'
runs-on: ubuntu-24.04
needs: combine
permissions:
contents: write
strategy:
matrix:
qt_version: [6.5.3, 6.6.3, 6.7.3]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Android_${{ matrix.qt_version }}
- name: Rename tarball
env:
TAG_NAME: ${{ github.ref_name }}
QT_VERSION: ${{ matrix.qt_version }}
run: |
mv maplibre-native-qt_Android.tar.bz2 maplibre-native-qt_${TAG_NAME}_Qt${QT_VERSION}_Android.tar.bz2
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: maplibre-native-qt_${{ github.ref_name }}_Qt${{ matrix.qt_version }}_Android.tar.bz2
allowUpdates: true
draft: true