build-android #508
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: build-android | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
# on: | |
# push: | |
# branches: | |
# - master | |
env: | |
QT_VERSION: 6.5.0 | |
jobs: | |
build: | |
name: Build for Android | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Qt for Desktop(mingw) | |
uses: jurplel/install-qt-action@v4 | |
with: | |
aqtversion: '==3.1.*' | |
target: 'desktop' | |
arch: 'win64_mingw' | |
host: 'windows' | |
dir: '${{ github.workspace }}' | |
modules: 'qtcharts qtserialbus qtserialport qtwebsockets' | |
version: '${{ env.QT_VERSION }}' | |
- name: Install Qt for Android | |
uses: jurplel/install-qt-action@v4 | |
with: | |
aqtversion: '==3.1.*' | |
target: 'android' | |
arch: 'android_armv7' | |
host: 'windows' | |
dir: '${{ github.workspace }}' | |
modules: 'qtcharts qtserialbus qtserialport qtwebsockets' | |
version: '${{ env.QT_VERSION }}' | |
- name: CMake for Android | |
shell: cmd | |
run: | | |
git fetch --tags | |
set JAVA_HOME=%JAVA_HOME_11_X64% | |
${{ github.workspace }}\Qt\${{ env.QT_VERSION }}\android_armv7\bin\qt-cmake.bat ^ | |
-G "MinGW Makefiles" ^ | |
-S . ^ | |
-B "build\armeabi_v7a" ^ | |
-DQT_HOST_PATH:PATH="${{ github.workspace }}\Qt\${{env.QT_VERSION}}\mingw_64" ^ | |
-DCMAKE_BUILD_TYPE:STRING=Release ^ | |
-DCMAKE_CXX_COMPILER:FILEPATH="%ANDROID_NDK_ROOT%/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" ^ | |
-DANDROID_SDK_ROOT:PATH="%ANDROID_SDK_ROOT%" ^ | |
-DANDROID_NDK_ROOT:PATH="%ANDROID_NDK_ROOT%" ^ | |
-DBUILD_SHARED_LIBS:BOOL=OFF ^ | |
-DWITH_TOOLS:BOOL=OFF | |
- name: Directory of build\armeabi_v7a | |
shell: cmd | |
run: dir build\armeabi_v7a | |
- name: Build for android | |
shell: cmd | |
run: | | |
set JAVA_HOME=%JAVA_HOME_11_X64% | |
echo %JAVA_HOME% | |
cmake --build build\armeabi_v7a --target xTools --config Release | |
- name: Directory of build\armeabi_v7a | |
shell: cmd | |
run: dir build\armeabi_v7a | |
- name: Deploy for Android | |
shell: cmd | |
run: | | |
set JAVA_HOME=%JAVA_HOME_11_X64% | |
echo %JAVA_HOME% | |
${{ github.workspace }}\Qt\${{env.QT_VERSION}}\mingw_64\bin\androiddeployqt.exe ^ | |
--input build\armeabi_v7a\android-xTools-deployment-settings.json ^ | |
--output build\armeabi_v7a\android-build ^ | |
--android-platform android-34 ^ | |
--sign ${{ github.workspace }}\Resources\Platforms\Android\xTools.keystore xTools --storepass xTools --keypass xTools ^ | |
--jdk %JAVA_HOME% --gradle --release |