Skip to content

adding separate deploy stage #40

adding separate deploy stage

adding separate deploy stage #40

Workflow file for this run

name: Android
on:
workflow_call:
workflow_dispatch:
push:
jobs:
build:
runs-on: thuban
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 -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: ${{github.ref}}
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 \
-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
- uses: r0adkll/sign-android-release@v1
name: Sign app AAB
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"
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
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"
- uses: actions/upload-artifact@v3
with:
name: android-apk
path: ${{steps.sign_apk.outputs.signedReleaseFile}}
- uses: actions/upload-artifact@v3
with:
name: android-abb
path: ${{steps.sign_aab.outputs.signedReleaseFile}}
deploy:
needs: build
if: github.ref == 'refs/heads/prepare-for-github-ci'
runs-on: thuban
steps:
- uses: actions/download-artifact@v3
- name: Rename APK
run: mv ./android-apk/android-build-release-unsigned-signed.apk ./android-apk/opc-ua-browser_${{ env.ANDROID_VERSION_NAME }}_${{ env.ANDROID_VERSION_CODE }}.apk
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
New Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./android-apk/opc-ua-browser_${{ env.ANDROID_VERSION_NAME }}_${{ env.ANDROID_VERSION_CODE }}.apk
asset_name: opc-ua-browser_${{ env.ANDROID_VERSION_NAME }}_${{ env.ANDROID_VERSION_CODE }}.apk
asset_content_type: application/zip
#- uses: r0adkll/upload-google-play@v1
# with:
# serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
# releaseFiles: "${{steps.sign_aab.outputs.signedReleaseFile}}"
# packageName: com.basyskom.opcua.app
# track: internal
# status: draft
# ./android-abb/android-build-release.aab
# ./android-apk/android-build-release-unsigned-signed.apk