#1806 #2106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.23-9/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.1 --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.1 --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 | |