not vfery pretty test #159
Workflow file for this run
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
on: | |
push: | |
tags: | |
- 'Beta*' | |
name: Commnader_Wars_Release | |
env: | |
BUILD_TYPE: Release | |
QT_Version: '6.5.2' | |
workspace: 'D:/a/Commander_Wars/Commander_Wars' | |
JAVA_PATH: 'C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/11.0.21-9/x64/' | |
ANDROID_OPEN_SSL_TAG: '7f5f34d16040883f7353b3f99bc3fc83ecdc2a4b' | |
jobs: | |
create_release: | |
name: Create release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
steps: | |
- name: Create release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
tag_name: ${{github.ref}} | |
release_name: Release ${{github.ref}} | |
draft: false | |
prerelease: true | |
body: | | |
Latest Commander Wars Release | |
See the github wiki for the related change log: | |
https://github.com/Robosturm/Commander_Wars/wiki | |
install: | |
name: All | |
strategy: | |
matrix: | |
buildTarget: [windows-desktop, windows-server, ubuntu-desktop, ubuntu-server, 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 --force -y --install-arguments="'/DIR=C:/openSsl/'" | |
installerCommands2: '' | |
source_asset: 'Commander_Wars.zip' | |
asset_name: 'Commander_Wars_Win10_x64.zip' | |
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"' | |
- buildTarget: windows-server | |
os: windows-latest | |
COMPILER_VERSION: 'win64_mingw' | |
target: 'desktop' | |
qtPath: 'mingw_64' | |
qtTools: 'tools_mingw90' | |
installerCommands1: choco install openssl --force -y --install-arguments="'/DIR=C:/openSsl/'" | |
installerCommands2: '' | |
source_asset: 'Commander_Wars.zip' | |
asset_name: 'Commander_Wars_Win10_x64_Server.zip' | |
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" -DGRAPHICSUPPORT=OFF -DAUDIOSUPPORT=OFF -DUPDATESUPPORT=OFF' | |
- 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' | |
source_asset: 'Commander_Wars.zip' | |
asset_name: 'Commander_Wars_Ubuntu.zip' | |
cmakeOptions: '' | |
- buildTarget: ubuntu-server | |
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' | |
source_asset: 'Commander_Wars.zip' | |
asset_name: 'Commander_Wars_Ubuntu_Server.zip' | |
cmakeOptions: '-DGRAPHICSUPPORT=OFF -DAUDIOSUPPORT=OFF -DUPDATESUPPORT=OFF' | |
- buildTarget: macos-desktop | |
os: macos-latest | |
COMPILER_VERSION: 'clang_64' | |
qtPath: 'clang_64' | |
qtTools: '' | |
target: 'desktop' | |
installerCommands1: '' | |
installerCommands2: '' | |
source_asset: 'Commander_Wars.zip' | |
asset_name: 'Commander_Wars_macOS.zip' | |
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: '' | |
source_asset: 'android-build/build/outputs/apk/release/android-build-release-signed.apk' | |
asset_name: 'Commander_Wars_armeabi-v7a.apk' | |
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: '' | |
source_asset: 'android-build/build/outputs/apk/release/android-build-release-signed.apk' | |
asset_name: 'Commander_Wars_arm64-v8a.apk' | |
cmakeOptions: '' | |
openSslabiPath: 'android_openssl/ssl_3/arm64-v8a' | |
needs: create_release | |
runs-on: ${{matrix.os}} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout openssl | |
if: matrix.target == 'android' | |
uses: actions/checkout@v3 | |
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/Commander_Wars_Release' \ | |
-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="${{github.ref}}" \ | |
-DCOW_UPDATETARGET="${{matrix.asset_name}}" \ | |
-DCOW_INSTALL_DIR="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: 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 | |
#---------------------------------------------------------------------------------------------------------------------------------------------- | |
# release creation and upload part | |
#---------------------------------------------------------------------------------------------------------------------------------------------- | |
- name: build artifacts | |
if: matrix.target != 'android' | |
run: cmake --build '${{github.workspace}}/build' --config $BUILD_TYPE --target createReleaseZip | |
- name: upload artifact android | |
if: matrix.target == 'android' | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{github.token}} | |
with: | |
upload_url: '${{needs.create_release.outputs.upload_url}}' | |
asset_path: '${{github.workspace}}/build/${{matrix.source_asset}}' | |
asset_name: '${{matrix.asset_name}}' | |
asset_content_type: application/zip | |
- name: upload other artifacts | |
if: matrix.target != 'android' | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{github.token}} | |
with: | |
upload_url: '${{needs.create_release.outputs.upload_url}}' | |
asset_path: '${{github.workspace}}/install/${{matrix.source_asset}}' | |
asset_name: '${{matrix.asset_name}}' | |
asset_content_type: application/zip | |
- name: upload unofficial compatible pack | |
uses: actions/[email protected] | |
if: matrix.buildTarget == 'windows-server' | |
env: | |
GITHUB_TOKEN: ${{github.token}} | |
with: | |
upload_url: '${{needs.create_release.outputs.upload_url}}' | |
asset_name: 'UnofficialCommanderWars_Win7CompatiblePack.zip' | |
asset_path: '${{github.workspace}}/source/3rd_party/unofficialWin7Support/UnofficialCommanderWars_Win7CompatiblePack.zip' | |
asset_content_type: application/zip |