Work on CI builds #180
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
#------------------------------------------------------------------------------- | |
# Workflow configuration | |
#------------------------------------------------------------------------------- | |
name: "Mobile CI builds" | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
#------------------------------------------------------------------------------- | |
# Define application name & version | |
#------------------------------------------------------------------------------- | |
env: | |
APP_NAME: "Theengs" | |
APP_VERSION: "1.4.1" | |
QT_VERSION: "6.6.3" | |
#------------------------------------------------------------------------------- | |
# Workflow jobs | |
#------------------------------------------------------------------------------- | |
jobs: | |
## Android build ############################################################# | |
build-android: | |
name: "Android CI build" | |
runs-on: ubuntu-20.04 | |
steps: | |
# Checkout repository (and submodules) | |
- name: Checkout repository (and submodules) | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Java environment (already installed in 'ubuntu-20.04') | |
- name: Setup Java environment | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
# Android environment (already installed in 'ubuntu-20.04') | |
#- name: Setup Android environment | |
# uses: android-actions/setup-android@v3 | |
#- name: Install Android SDK / NDK / tools | |
# run: | | |
# sdkmanager "platforms;android-34" | |
# sdkmanager "ndk;26.3.11579264" | |
# sdkmanager "build-tools;34.0.0" | |
# Install Qt (Android & desktop) | |
- name: Install Qt (Android & desktop) | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{env.QT_VERSION}} | |
host: 'linux' | |
target: 'android' | |
arch: 'android_arm64_v8a' | |
modules: qtconnectivity qtwebsockets qtcharts qtshadertools qt5compat | |
extra: '--autodesktop' | |
# Setup env | |
- name: Setup env | |
run: | | |
sudo apt-get install cmake ninja-build libtool automake m4 gettext -y | |
qmake --version | |
ninja --version | |
# Build dependencies (from contribs script) | |
- name: Build dependencies (from contribs script) | |
run: | | |
cd contribs/ | |
python3 contribs_builder.py --qt-directory ${{env.QT_ROOT_DIR}}/../.. --qt-version ${{env.QT_VERSION}} --targets=android_armv8 | |
cd .. | |
# Build application | |
- name: Build application | |
run: | | |
qmake ${{env.APP_NAME}}.pro CONFIG+=release | |
make -j$(nproc) | |
## iOS build ################################################################# | |
build-ios: | |
name: "iOS CI build" | |
runs-on: macos-12 | |
steps: | |
# Checkout repository (and submodules) | |
- name: Checkout repository (and submodules) | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Install Qt (iOS & desktop) | |
- name: Install Qt (iOS & desktop) | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{env.QT_VERSION}} | |
host: 'mac' | |
target: 'ios' | |
modules: qtconnectivity qtwebsockets qtcharts qtshadertools qt5compat | |
extra: '--autodesktop' | |
# Setup env | |
- name: Setup env | |
run: | | |
brew install cmake ninja automake autoconf libtool pkg-config | |
qmake --version | |
# Build dependencies (from contribs script) | |
- name: Build dependencies (from contribs script) | |
run: | | |
cd contribs/ | |
python3 contribs_builder.py --qt-directory ${{env.QT_ROOT_DIR}}/../.. --qt-version ${{env.QT_VERSION}} --targets=ios_armv8 | |
cd .. | |
# Build application | |
- name: Build application | |
run: | | |
qmake ${{env.APP_NAME}}.pro CONFIG+=release | |
make -j`sysctl -n hw.logicalcpu` |