-
-
Notifications
You must be signed in to change notification settings - Fork 19
125 lines (109 loc) · 4.02 KB
/
builds_mobile_cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#-------------------------------------------------------------------------------
# Workflow configuration
#-------------------------------------------------------------------------------
name: "Mobile CI builds (cmake)"
on:
push:
pull_request:
#-------------------------------------------------------------------------------
# Define application name & version
#-------------------------------------------------------------------------------
env:
APP_NAME: "QmlAppTemplate"
APP_VERSION: "0.6"
QT_VERSION: "6.5.2"
#-------------------------------------------------------------------------------
# Workflow jobs
#-------------------------------------------------------------------------------
jobs:
## Android build #############################################################
build-android:
name: "Android CI build"
runs-on: ubuntu-20.04
steps:
# Checkout the repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v4
with:
submodules: recursive
# Java environment (already installed in 'ubuntu-20.04')
#- name: Install JDK environment
# uses: actions/setup-java@v2
# with:
# distribution: 'zulu'
# java-version: '11'
# Android environment (already installed in 'ubuntu-20.04')
#- name: Setup Android SDK
# uses: android-actions/setup-android@v2
#- name: Install Android SDK / NDK / tools
# run: |
# sdkmanager "platforms;android-33"
# sdkmanager "ndk;25.2.9519653"
# sdkmanager "build-tools;33.0.2"
# Install Qt (Android & desktop)
- name: Install Qt (Android & desktop)
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
host: 'linux'
target: 'android'
arch: 'android_arm64_v8a'
modules: qt5compat
aqtversion: '==3.1.*'
py7zrversion: '==0.20.*'
extra: '--autodesktop'
# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
run: |
sudo apt-get install cmake ninja-build -y;
# Setup env
- name: Setup env
run: |
export PATH=$Qt6_DIR/bin:$PATH
cmake --version
# Build application
- name: Build application
run: |
qt-cmake -B build/ -DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_TOOLCHAIN_FILE=${{env.ANDROID_SDK_ROOT}}/build/cmake/android.toolchain.cmake \
-DANDROID_SDK_ROOT=${{env.ANDROID_SDK_ROOT}} \
-DANDROID_NDK_ROOT=${{env.ANDROID_NDK_ROOT}} \
-DANDROID_PLATFORM=android-23 \
-DQT_ANDROID_BUILD_ALL_ABIS
cmake --build build/ --config Release
## iOS build #################################################################
build-ios:
name: "iOS CI build"
runs-on: macos-12
steps:
# Checkout the repository (and submodules)
- name: Checkout repository (and submodules)
uses: actions/checkout@v3
with:
submodules: recursive
# Install Qt (iOS & desktop)
- name: Install Qt (iOS & desktop)
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
host: 'mac'
target: 'ios'
modules: qt5compat qtshadertools
aqtversion: '==3.1.*'
py7zrversion: '==0.20.*'
extra: '--autodesktop'
# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
run: |
brew install cmake
# Setup env
- name: Setup env
run: |
export PATH=$Qt6_DIR/bin:$PATH
cmake --version
alias nproc="sysctl -n hw.logicalcpu"
# Build application
- name: Build application
run: |
qt-cmake -B build/ -G Xcode -DCMAKE_TOOLCHAIN_FILE=assets/ios/ios.toolchain.cmake -DPLATFORM=OS64
cmake --build build/ --config Release