CI: Build Android on Windows and MacOS #252
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
name: Android | |
on: | |
push: | |
branches: | |
- master | |
- 'Stable*' | |
tags: | |
- 'v*' | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '.github/workflows/docs_deploy.yml' | |
- '.github/workflows/linux.yml' | |
- '.github/workflows/macos.yml' | |
- '.github/workflows/windows.yml' | |
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" | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
BuildType: [Debug, Release] | |
defaults: | |
run: | |
shell: bash | |
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 Android (armv7) | |
uses: ./install-qt-action/action/ | |
if: contains( env.QT_ANDROID_ABIS, 'armeabi-v7a') | |
with: | |
version: ${{ env.QT_VERSION }} | |
host: linux | |
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: linux | |
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: linux | |
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: linux | |
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: sudo apt-get install -y ninja-build | |
- 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 }}/../gcc_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: Upload Build File | |
uses: ./.github/actions/upload | |
if: matrix.BuildType == 'Release' | |
with: | |
artifact_name: ${{ env.ARTIFACT }} | |
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
source: '' | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
BuildType: [Debug, Release] | |
defaults: | |
run: | |
shell: cmd | |
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 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 | |
- name: Create build directory | |
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 }} | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
BuildType: [Debug, Release] | |
defaults: | |
run: | |
shell: bash | |
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 Android (armv7) | |
uses: ./install-qt-action/action/ | |
if: contains( env.QT_ANDROID_ABIS, 'armeabi-v7a') | |
with: | |
version: ${{ env.QT_VERSION }} | |
host: mac | |
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: mac | |
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: mac | |
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: mac | |
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: | | |
brew update | |
brew install ninja cmake | |
- 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 }}/../macos" | |
-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 }} |