-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (126 loc) · 4.81 KB
/
android.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
126
127
128
129
130
name: Android Build
on:
workflow_call:
workflow_dispatch:
push:
branches:
- '**'
- '!main'
env:
QTOPCUA_BUILD_ARGS: "-DFEATURE_open62541_security:BOOL=ON -DFEATURE_gds:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DFEATURE_datatypecodegenerator=OFF"
QT_PATH: "/opt/Qt/6.7.1"
SSL_PATH: "dependencies/android_openssl/ssl_3"
ANDROID_VERSION_CODE: ${{github.run_number}}
ANDROID_VERSION_NAME: "1.0.0"
jobs:
android-build:
runs-on: ubuntu-latest
container:
image: stateoftheartio/qt6:6.7-android-aqt
options: --user root
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get dependencies
run: ./get_dependencies.sh
- name: Build qtopcua for arm64_v8a
run: |
HOME_DIR=$(pwd)
export BUILD_ARCH=arm64_v8a
mkdir -p build
qt-cmake ./dependencies/qtopcua -G Ninja -B ./build/qtopcua \
${QTOPCUA_BUILD_ARGS} \
-DCMAKE_INSTALL_PREFIX=${QT_PATH}/android_arm64_v8a \
-DOPENSSL_INCLUDE_DIR=${HOME_DIR}/${SSL_PATH}/include/ \
-DOPENSSL_ROOT_DIR=${HOME_DIR}/${SSL_PATH}/arm64-v8a/
cmake --build ./build/qtopcua
/opt/Qt/Tools/CMake/bin/cmake --install ./build/qtopcua
rm -rf ./build/qtopcua
- name: Build qtopcua for x86
run: |
HOME_DIR=$(pwd)
export BUILD_ARCH=x86
mkdir -p build
qt-cmake ./dependencies/qtopcua -G Ninja -B ./build/qtopcua \
${QTOPCUA_BUILD_ARGS} \
-DCMAKE_INSTALL_PREFIX=${QT_PATH}/android_x86 \
-DOPENSSL_INCLUDE_DIR=${HOME_DIR}/${SSL_PATH}/include/ \
-DOPENSSL_ROOT_DIR=${HOME_DIR}/${SSL_PATH}/x86/
cmake --build ./build/qtopcua
/opt/Qt/Tools/CMake/bin/cmake --install ./build/qtopcua
rm -rf ./build/qtopcua
- name: Build qtopcua for x86_64
run: |
HOME_DIR=$(pwd)
export BUILD_ARCH=x86_64
mkdir -p build
qt-cmake ./dependencies/qtopcua -G Ninja -B ./build/qtopcua \
${QTOPCUA_BUILD_ARGS} \
-DCMAKE_INSTALL_PREFIX=${QT_PATH}/android_x86_64 \
-DOPENSSL_INCLUDE_DIR=${HOME_DIR}/${SSL_PATH}/include/ \
-DOPENSSL_ROOT_DIR=${HOME_DIR}/${SSL_PATH}/x86_64/
cmake --build ./build/qtopcua
/opt/Qt/Tools/CMake/bin/cmake --install ./build/qtopcua
rm -rf ./build/qtopcua
- name: Build qtopcua for armv7
run: |
HOME_DIR=$(pwd)
export BUILD_ARCH=armv7
mkdir -p build
qt-cmake ./dependencies/qtopcua -G Ninja -B ./build/qtopcua \
${QTOPCUA_BUILD_ARGS} \
-DCMAKE_INSTALL_PREFIX=${QT_PATH}/android_armv7 \
-DOPENSSL_INCLUDE_DIR=${HOME_DIR}/${SSL_PATH}/include/ \
-DOPENSSL_ROOT_DIR=${HOME_DIR}/${SSL_PATH}/armeabi-v7a/
cmake --build ./build/qtopcua
/opt/Qt/Tools/CMake/bin/cmake --install ./build/qtopcua
rm -rf ./build/qtopcua
- name: Check if we build a tag
id: checkref
run: echo ::set-output name=is_tag::$(echo "${{ github.ref }}" | grep -q '^refs/tags/' && echo true || echo false)
- name: Set Version
if: steps.checkref.outputs.is_tag == 'true'
run: |
TAG=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///')
echo "ANDROID_VERSION_NAME=$TAG" >> $GITHUB_ENV
- name: Build App
run: |
mkdir -p ./build/opc_ua_browser && \
qt-cmake . -G Ninja -B ./build/opc_ua_browser \
-DQT_ANDROID_BUILD_ALL_ABIS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DANDROID_VERSION_CODE=${ANDROID_VERSION_CODE} \
-DANDROID_VERSION_NAME=${ANDROID_VERSION_NAME} && \
cmake --build ./build/opc_ua_browser --target aab && \
cmake --build ./build/opc_ua_browser --target apk
- name: Sign app AAB
uses: r0adkll/sign-android-release@v1
id: sign_aab
with:
releaseDirectory: build/opc_ua_browser/src/android-build/build/outputs/bundle/release/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Sign app APK
uses: r0adkll/sign-android-release@v1
id: sign_apk
with:
releaseDirectory: build/opc_ua_browser/src/android-build/build/outputs/apk/release/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: android-apk
path: ${{steps.sign_apk.outputs.signedReleaseFile}}
- name: Upload ABB
uses: actions/upload-artifact@v3
with:
name: android-abb
path: ${{steps.sign_aab.outputs.signedReleaseFile}}