-
Notifications
You must be signed in to change notification settings - Fork 31
213 lines (197 loc) · 9.37 KB
/
main.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
name: Commnader_Wars
on: [push]
env:
BUILD_TYPE: Release
QT_Version: '6.6.2'
workspace: 'D:/a/Commander_Wars/Commander_Wars'
GCC_PATH: 'D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1120_64/bin/'
JAVA_PATH: 'C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/11.0.24-8/x64/'
ANDROID_OPEN_SSL_TAG: '57056d6dd94c235a67b1bc0e4befdba8f9e11c8d'
jobs:
install:
name: All
strategy:
fail-fast: false
matrix:
buildTarget: [windows-desktop, windows-server, ubuntu-desktop, macos-desktop, android-armv7, android-arm64_v8a]
include:
- buildTarget: windows-desktop
os: windows-latest
COMPILER_VERSION: 'win64_mingw'
target: 'desktop'
qtPath: 'mingw_64'
qtTools: 'tools_mingw90'
installerCommands1: choco install openssl --version=3.3.2 --force -y --install-arguments="'/DIR=C:/openSsl/'"
installerCommands2: ''
cmakeOptions: '"-DCMAKE_GENERATOR:STRING=MinGW Makefiles" -DOPENSSL_LIB_PATH="C:/openSsl/bin" -DOPENSSL_INCLUDE_DIR="C:/openSsl/include" -DOPENSSL_USE_STATIC_LIBS="ON" -DPRECOMPILEDOPENSSL="ON" "-DCMAKE_C_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1120_64/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1120_64/bin/g++.exe"'
- buildTarget: windows-server # test build to check if the server configuration compiles as well
os: windows-latest
COMPILER_VERSION: 'win64_mingw'
target: 'desktop'
qtPath: 'mingw_64'
qtTools: 'tools_mingw90'
installerCommands1: choco install openssl --version=3.3.2 --force -y --install-arguments="'/DIR=C:/openSsl/'"
installerCommands2: ''
cmakeOptions: '"-DCMAKE_GENERATOR:STRING=MinGW Makefiles" -DOPENSSL_LIB_PATH="C:/openSsl/bin" -DOPENSSL_INCLUDE_DIR="C:/openSsl/include" -DOPENSSL_USE_STATIC_LIBS="ON" -DPRECOMPILEDOPENSSL="ON" -DOPENSSL_USE_STATIC_LIBS=FALSE -DGRAPHICSUPPORT=OFF -DAUDIOSUPPORT=OFF -DUPDATESUPPORT=OFF "-DCMAKE_C_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1120_64/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1120_64/bin/g++.exe"'
- buildTarget: ubuntu-desktop
os: ubuntu-latest
COMPILER_VERSION: ''
target: 'desktop'
qtPath: ''
qtTools: ''
installerCommands1: 'sudo apt-get update'
installerCommands2: 'sudo apt-get install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio'
cmakeOptions: ''
- buildTarget: macos-desktop
os: macos-latest
COMPILER_VERSION: 'clang_64'
qtPath: 'clang_64'
qtTools: ''
target: 'desktop'
installerCommands1: ''
installerCommands2: ''
cmakeOptions: '-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl'
- buildTarget: android-armv7
os: windows-latest
COMPILER_VERSION: 'android_armv7'
qtPath: 'android_armv7'
qtTools: ''
target: 'android'
target-api-level: '23'
abi : "armeabi-v7a"
COMPILER_TOOLS_VERSION: 'win64_mingw'
qtCoreToolsPath: 'mingw_64'
installerCommands1: 'choco install ninja'
installerCommands2: ''
cmakeOptions: ''
openSslabiPath: 'android_openssl/ssl_3/armeabi-v7a'
- buildTarget: android-arm64_v8a
os: windows-latest
COMPILER_VERSION: 'android_arm64_v8a'
qtPath: 'android_arm64_v8a'
qtTools: ''
target: 'android'
target-api-level: '23'
abi : "arm64-v8a"
COMPILER_TOOLS_VERSION: 'win64_mingw'
qtCoreToolsPath: 'mingw_64'
installerCommands1: 'choco install ninja'
installerCommands2: ''
cmakeOptions: ''
openSslabiPath: 'android_openssl/ssl_3/arm64-v8a'
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash
steps:
- name: Checkout openssl
if: matrix.target == 'android'
uses: actions/checkout@v4
with:
repository: 'KDAB/android_openssl'
ref: ${{env.ANDROID_OPEN_SSL_TAG}}
path: 'android_openssl'
- name: Checkout source code
uses: actions/checkout@v4
with:
path: 'source'
submodules: 'true'
- name: Install host os qt
if: matrix.target == 'android'
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.0.2'
target: 'desktop'
version: ${{env.QT_Version}}
arch: ${{matrix.COMPILER_TOOLS_VERSION}}
dir: '${{github.workspace}}/qt/'
install-deps: "true"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
target: ${{matrix.target}}
version: ${{env.QT_Version}}
arch: ${{matrix.COMPILER_VERSION}}
modules: 'qtmultimedia'
dir: '${{github.workspace}}/qt/'
install-deps: "true"
tools: '${{matrix.qtTools}}'
set-env: 'true'
- name: Install OS Dependencies 1
run: ${{matrix.installerCommands1}}
- name: Install OS Dependencies 2
run: ${{matrix.installerCommands2}}
- name: Configure other cmake
if: matrix.target != 'android'
run: |
cmake \
-S "${{github.workspace}}/source" \
-B '${{github.workspace}}/build' \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_INSTALL_PREFIX='${{github.workspace}}/install' \
-DCMAKE_PREFIX_PATH="${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtPath}}/" \
-DQt6_DIR="${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtPath}}/lib/cmake/Qt6/" \
-DUPDATESUPPORT=ON \
-DCOW_BUILD_TAG="Dummy" \
-DCOW_UPDATETARGET="Dummy" \
-DCOW_INSTALLDIR="Commander_Wars_Release" \
${{matrix.cmakeOptions}}
- name: Configure android cmake
if: matrix.target == 'android'
run: |
cmake \
-S "${{github.workspace}}/source" \
-B "${{github.workspace}}/build" \
-DCMAKE_GENERATOR="Ninja" \
-DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" \
-DQT_QMAKE_EXECUTABLE="${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtPath}}/bin/qmake.bat" \
-DCMAKE_PREFIX_PATH="${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtPath}}/" \
-DANDROID_NATIVE_API_LEVEL="${{matrix.target-api-level}}" \
-DANDROID_NDK="${ANDROID_NDK_ROOT}" \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake" \
-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON \
-DANDROID_ABI="${{matrix.abi}}" \
-DANDROID_STL="c++_static" \
-DCMAKE_FIND_ROOT_PATH="${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtPath}}/" \
-DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL=ON \
-DQT_HOST_PATH="${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtCoreToolsPath}}" \
-DANDROID_SDK_ROOT="${ANDROID_SDK_ROOT}" \
-DCMAKE_CXX_FLAGS_INIT:STRING="" \
-DOPENSSL_LIB_PATH="${{github.workspace}}/${{matrix.openSslabiPath}}" \
-DOPENSSL_INCLUDE_DIR="${{github.workspace}}/android_openssl/ssl_3/include" \
-DOPENSSL_USE_STATIC_LIBS=ON \
-DPRECOMPILEDOPENSSL=ON \
-DUPDATESUPPORT=OFF \
-DDEFAULTAIPIPE=OFF \
-DCOW_BUILD_TAG="Dummy" \
-DCOW_UPDATETARGET="Dummy" \
-DCOW_INSTALL_DIR="Commander_Wars_Release" \
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
- name: Build other
if: matrix.target != 'android'
working-directory: '${{github.workspace}}/build'
run: cmake --build '${{github.workspace}}/build' --target install -j4
- name: Build android
if: matrix.target == 'android'
working-directory: '${{github.workspace}}/build'
run: cmake --build '${{github.workspace}}/build' --target all -j4
- name: create pdb
if: matrix.COMPILER_VERSION == 'win64_mingw'
run: cmake --build '${{github.workspace}}/build' --config $BUILD_TYPE --target createPdb
- name: Bundle APK
if: matrix.target == 'android'
env:
QT_ANDROID_KEYSTORE_PATH: ${{env.workspace}}/source/android/android_release.keystore
QT_ANDROID_KEYSTORE_ALIAS: ${{secrets.ANDROIDALIAS}}
QT_ANDROID_KEYSTORE_STORE_PASS: ${{secrets.ANDROIDSTOREPASS}}
QT_ANDROID_KEYSTORE_KEY_PASS: ${{secrets.ANDROIDSTOREPASS}}
JAVA_HOME: ${{env.JAVA_PATH}}
run: |
"${{github.workspace}}/qt/Qt/${{env.QT_Version}}/${{matrix.qtCoreToolsPath}}/bin/androiddeployqt.exe" \
--input ${{env.workspace}}/build/android-Commander_Wars-deployment-settings.json \
--output ${{env.workspace}}/build/android-build \
--android-platform android-33 \
--gradle \
--release \
--sign