Skip to content

Android Build

Android Build #10

Workflow file for this run

name: Android
on:
workflow_call:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: stateoftheartio/qt6:6.6-android-aqt
options: --user root
timeout-minutes: 60
env:
QTOPCUA_BUILD_ARGS: "-DFEATURE_open62541_security:BOOL=ON -DFEATURE_gds:BOOL=ON"
QT_PATH: "/opt/Qt/6.6.1"
SSL_PATH: "dependencies/android_openssl/ssl_3"
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: Build App
run: |
mkdir -p ./build/opc_ua_browser && \
qt-cmake . -G Ninja -B ./build/opc_ua_browser -DQT_ANDROID_BUILD_ALL_ABIS=ON && \
cmake --build ./build/opc_ua_browser --target aab && \
cmake --build ./build/opc_ua_browser --target apk
- uses: r0adkll/sign-android-release@v1
name: Sign app AAB
id: sign_aab
with:
releaseDirectory: build/opc_ua_browser/android-build/build/outputs/bundle/release/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "33.0.0"
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
id: sign_apk
with:
releaseDirectory: build/opc_ua_browser/android-build/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "33.0.0"
- uses: actions/upload-artifact@v2
with:
name: Signed app bundle
path: ${{steps.sign_apk.outputs.signedReleaseFile}}
- uses: actions/upload-artifact@v2
with:
name: Signed app bundle
path: ${{steps.sign_aab.outputs.signedReleaseFile}}
- uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
releaseFiles: ${{steps.sign_aab.outputs.signedReleaseFile}}
packageName: org.basyskom.opcuabrowser
track: qa
changesNotSentForReview: true