Skip to content

Add infrastructure for CS event dashboards #142

Add infrastructure for CS event dashboards

Add infrastructure for CS event dashboards #142

Workflow file for this run

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"
QT_PATH: "/opt/Qt/6.6.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.6-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: "33.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: "33.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}}