forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (135 loc) · 5.73 KB
/
android-windows.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
name: Android-Windows
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
BuildType: [Debug, Release]
defaults:
run:
shell: cmd
env:
ARTIFACT: QGroundControl.apk
QT_VERSION: 6.6.3
QT_ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/deploy/android/android_release.keystore
QT_ANDROID_KEYSTORE_ALIAS: QGCAndroidKeyStore
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_KEYSTORE_KEY_PASS: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
QT_ANDROID_ABIS: "armeabi-v7a;arm64-v8a"
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
- uses: actions/checkout@v4
with:
repository: jurplel/install-qt-action
ref: master
path: install-qt-action
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: install-qt-action/action/
- name: Build jurplel/install-qt-action
run: |
cd install-qt-action/action/
npm ci || npm install
npm run build
shell: bash
- name: Install Qt6 for Windows
uses: ./install-qt-action/action/
with:
version: ${{ env.QT_VERSION }}
host: windows
target: desktop
dir: ${{ runner.temp }}
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
tools: 'tools_cmake'
- name: Install Qt6 for Android (armv7)
uses: ./install-qt-action/action/
if: contains( env.QT_ANDROID_ABIS, 'armeabi-v7a')
with:
version: ${{ env.QT_VERSION }}
host: windows
target: android
arch: android_armv7
dir: ${{ runner.temp }}
extra: --autodesktop
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
- name: Install Qt6 for Android (arm64_v8a)
uses: ./install-qt-action/action/
if: contains( env.QT_ANDROID_ABIS, 'arm64-v8a')
with:
version: ${{ env.QT_VERSION }}
host: windows
target: android
arch: android_arm64_v8a
dir: ${{ runner.temp }}
extra: --autodesktop
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
- name: Install Qt6 for Android (x86)
uses: ./install-qt-action/action/
if: contains( env.QT_ANDROID_ABIS, 'x86')
with:
version: ${{ env.QT_VERSION }}
host: windows
target: android
arch: android_x86
dir: ${{ runner.temp }}
extra: --autodesktop
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
- name: Install Qt6 for Android (x86_64)
uses: ./install-qt-action/action/
if: contains( env.QT_ANDROID_ABIS, 'x86_64')
with:
version: ${{ env.QT_VERSION }}
host: windows
target: android
arch: android_x86_64
dir: ${{ runner.temp }}
extra: --autodesktop
modules: qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d
cache: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
- name: Install Dependencies
run: |
choco install --no-progress ninja -y
choco install --no-progress cmake --installargs 'ADD_CMAKE_TO_PATH=System' --apply-install-arguments-to-dependencies
- name: Set up Visual Studio shell
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- run: mkdir ${{ runner.temp }}/shadow_build_dir
- name: Configure
working-directory: ${{ runner.temp }}/shadow_build_dir
run: ${{ env.QT_ROOT_DIR }}/bin/qt-cmake -S ${{ github.workspace }} -B . -G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
-DQT_ANDROID_ABIS="${{ env.QT_ANDROID_ABIS }}"
-DQT_ANDROID_BUILD_ALL_ABIS=OFF
-DQT_HOST_PATH="${{ env.QT_ROOT_DIR }}/../msvc2019_64"
-DQT_ANDROID_SIGN_APK=${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && 'ON' || 'OFF' }}
-DQT_DEBUG_FIND_PACKAGE=ON
-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 --config ${{ matrix.BuildType }}
- name: Prepare APK
working-directory: ${{ runner.temp }}/shadow_build_dir
run: cp ./android-build/*.apk ./${{ env.ARTIFACT }}
- name: Save APK
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT }}
path: ${{ runner.temp }}/shadow_build_dir/android-build/*.apk