gui_tools:backport from https://github.com/QQxiaoming/quardCRT.git #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: android | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/android.yml' | |
- 'quard_star_tools/**' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/android.yml' | |
- 'quard_star_tools/**' | |
workflow_dispatch: | |
jobs: | |
quard_star_tools_android_build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install prerequisites | |
shell: bash -l {0} | |
run: | | |
sudo apt update | |
sudo apt install -y make gcc | |
- name: Install Qt android | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.5.2' | |
modules: 'qt5compat qtwebsockets' | |
aqtversion: ==3.1.7 | |
- name: Install Qt android | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.5.2' | |
modules: 'qt5compat qtwebsockets' | |
aqtversion: ==3.1.7 | |
target: 'android' | |
arch: 'android_arm64_v8a' | |
- name: Install Android NDK | |
shell: bash | |
# Links to NDK are at https://github.com/android/ndk/wiki/Unsupported-Downloads | |
run: | | |
curl -O "https://dl.google.com/android/repository/android-ndk-r25b-linux.zip" | |
unzip "android-ndk-r25b-linux.zip" | |
- name: Build all | |
shell: bash -l {0} | |
env: | |
QT_VERSION: 6.5.2 | |
run: | | |
export ANDROID_NDK_ROOT=$(pwd)/android-ndk-r25b | |
export ANDROID_BUILD_DIR=$(pwd)/android-build | |
cd quard_star_tools | |
git describe --always --long --abbrev=10 --exclude '*' | awk '{print "\""$0"\""}' > git_tag.inc | |
sed -i 's/git_tag.inc/git_tag.ci.inc/g' quard_star_tools.pro | |
lrelease quard_star_tools.pro | |
${Qt6_DIR}/bin/qmake -makefile | |
make | |
make apk | |
mv android-build/quard_star_tools.apk ../ | |
- name: Upload build asserts | |
uses: actions/[email protected] | |
with: | |
name: quard_star_tools_android | |
path: | | |
quard_star_tools.apk |