forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 2
208 lines (183 loc) · 6.87 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
name: Android 32/64-bit
on:
push:
branches:
- master
- 'Stable*'
tags:
- 'v*'
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
defaults:
run:
shell: bash
jobs:
build_debug:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
- name: Setup Java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Set up Cache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ runner.os }}-Android-Debug
restore-keys: ${{ runner.os }}-Android-Debug
max-size: 1G
append-timestamp: false
- name: Install Qt for Linux
uses: jurplel/install-qt-action@v3
with:
version: 6.6.*
aqtversion: ==3.1.*
host: linux
target: desktop
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
setup-python: true
cache: true
- name: Install Qt6 for Android (armv7)
uses: jurplel/install-qt-action@v3
with:
version: 6.6.*
aqtversion: ==3.1.*
host: linux
target: android
arch: android_armv7
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: true
- name: Install Qt6 for Android (arm64_v8a)
uses: jurplel/install-qt-action@v3
with:
version: 6.6.*
aqtversion: ==3.1.*
host: linux
target: android
arch: android_arm64_v8a
extra: --autodesktop
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: true
- name: Install dependencies
working-directory: ${{ github.workspace }}
env:
GST_VERSION: 1.18.5
run: |
sudo apt update
sudo apt install -y ninja-build
wget --quiet https://gstreamer.freedesktop.org/data/pkg/android/${GST_VERSION}/gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz
mkdir gstreamer-1.0-android-universal-${GST_VERSION}
tar xf gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz -C gstreamer-1.0-android-universal-${GST_VERSION}
- name: Setup env
run: |
echo "QT_HOST_PATH=${Qt6_DIR}/../gcc_64" >> $GITHUB_ENV
chmod a+x ${Qt6_DIR}/bin/qt-cmake
mkdir ${{ runner.temp }}/shadow_build_dir
- name: Configure
working-directory: ${{ runner.temp }}/shadow_build_dir
env:
STABLE_BUILD: ${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') }}
run: ${Qt6_DIR}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.BuildType }} \
-DQT_ANDROID_ABIS="armeabi-v7a;arm64-v8a" \
-DQT_HOST_PATH=${{ env.QT_HOST_PATH }} \
-DQT_DEBUG_FIND_PACKAGE=ON \
-DQT_ANDROID_MULTI_ABI_FORWARD_VARS=="QGC_STABLE_BUILD" \
-DQGC_STABLE_BUILD=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'ON' || 'OFF' }}
- name: Build
working-directory: ${{ runner.temp }}/shadow_build_dir
run: cmake --build . --target all
build_release:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- eabi: armeabi-v7a
arch: android_armv7
ARTIFACT: QGroundControl32.apk
- eabi: arm64-v8a
arch: android_arm64_v8a
ARTIFACT: QGroundControl64.apk
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
- name: Setup Java environment
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Set up Cache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
key: ${{ runner.os }}-${{ matrix.arch }}-Release
restore-keys: ${{ runner.os }}-${{ matrix.arch }}-Release
max-size: 1G
append-timestamp: false
- name: Install Qt for Linux
uses: jurplel/install-qt-action@v3
with:
version: 6.6.*
aqtversion: ==3.1.*
host: linux
target: desktop
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
setup-python: true
cache: true
- name: Install Qt6 for Android
uses: jurplel/install-qt-action@v3
with:
version: 6.6.*
aqtversion: ==3.1.*
host: linux
target: android
arch: ${{ matrix.arch }}
extra: --autodesktop
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: true
- name: Install dependencies
working-directory: ${{ github.workspace }}
env:
GST_VERSION: 1.18.5
run: |
sudo apt update
sudo apt install -y ninja-build
wget --quiet https://gstreamer.freedesktop.org/data/pkg/android/${GST_VERSION}/gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz
mkdir gstreamer-1.0-android-universal-${GST_VERSION}
tar xf gstreamer-1.0-android-universal-${GST_VERSION}.tar.xz -C gstreamer-1.0-android-universal-${GST_VERSION}
- name: Create build directory
run: mkdir ${{ runner.temp }}/shadow_build_dir
- name: Configure
working-directory: ${{ runner.temp }}/shadow_build_dir
env:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
run: qmake -r ${{ github.workspace }}/qgroundcontrol.pro -spec android-clang \
ANDROID_ABIS="${{ matrix.eabi }}" \
CONFIG+=installer \
CONFIG+=${{ github.ref_type == 'tag' || contains(github.ref, 'Stable') && 'StableBuild' || 'DailyBuild' }}
- name: Build
working-directory: ${{ runner.temp }}/shadow_build_dir
run: make -j$(nproc)
- name: Upload Build File
uses: ./.github/actions/upload
with:
artifact_name: ${{ matrix.ARTIFACT }}
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}