Skip to content

Commit

Permalink
Merge pull request #785 from tenzap/next-035-qt651
Browse files Browse the repository at this point in the history
update github actions workflow for android & linux
  • Loading branch information
AlbrechtL authored Oct 18, 2023
2 parents 6b69a78 + 51cd22f commit 8426077
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 42 deletions.
74 changes: 41 additions & 33 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ name: Android build
# If you want to build welle.io for Android yourself and produce a Multi-ABI
# APK or AAB you might encouter these issues:
#
# - QTBUG-101353: this is already managed inside welle.io by making different
# calls depending on the Qt Version.
#
# These issues may get revealed if you need/choose to specify a QT_HOST_PATH
# and/or need to use QT_HOST_PATH_CMAKE_DIR
# - QTBUG-106394: Android Multi ABI honors only for first abi the flag
# -DQT_NO_PACKAGE_VERSION_CHECK=TRUE
# Fixed in 6.5.0 Beta1
# - QTBUG-106616: androiddeployqt not found on MultiABI android build with
# custom install dir
# Suggested patch in bug report
#
# All fixes related to these QTBUGs have been backported into qt-android-6.3
# but not necessarily in the official release of Qt of that version
#
# MultiABI build is only available since Qt 6.3. If you use Qt 6.2, you must
# build each ABI individually.
#
Expand All @@ -41,13 +26,13 @@ jobs:
runs-on: ubuntu-22.04
env:
QT_ANDROID_JOB_REPO: bullseye-backports
QT_ANDROID_JOB_ID: 3336222 # Qt6.4.0
QT_ANDROID_JOB_ID: 4247878 # Qt6.5.1 + custom install dir

#QT_ANDROID_JOB_REPO: testing
#QT_ANDROID_JOB_ID: 3206460 # Qt6.3 android-buil with OS's Host Qt (=doesn't provide qt-android-X.Y-host)

QT_ANDROID_PACKAGE: qt-android-6.4
QT_ANDROID_HOST_HAS_CUSTOM_INSTALL_DIR: false # relevant only when not using OS's host Qt
QT_ANDROID_PACKAGE: qt-android-6.5
QT_ANDROID_HOST_HAS_CUSTOM_INSTALL_DIR: true # relevant only when not using OS's host Qt
USE_OS_QT_AS_HOST: false
USE_OS_QT_AS_HOST_FROM_TESTING: true

Expand All @@ -62,7 +47,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- run: git fetch --prune --unshallow --tags

Expand Down Expand Up @@ -140,12 +125,12 @@ jobs:
PACKAGE_FOR_BUILD="$(echo "${PACKAGES_FOR_ABI}" | head -n1 )" &&
# Find the path to the bin folder (qmake, qt-cmake)
QT_INSTALL_BINDIR="$(dirname "$(dpkg -S "bin/qmake" | grep "$PACKAGE_FOR_BUILD" | cut -f 2 -d " ")")"
QT_INSTALL_BINDIR="$(dirname "$(dpkg -S "bin/qmake" | grep 'bin/qmake$' | grep "$PACKAGE_FOR_BUILD:" | cut -f 2 -d " ")")"
echo "QT_INSTALL_BINDIR: $QT_INSTALL_BINDIR" &&
echo "QT_INSTALL_BINDIR=${QT_INSTALL_BINDIR}" >> $GITHUB_ENV
##### Get the QT_PATH_ANDROID_ABI_$abi & QT_PATH_CMAKE_DIR_ANDROID_ABI_$abi
##### Get the QT_PATH_ANDROID_ABI_$abi & QT_ANDROID_PATH_CMAKE_DIR_$abi
for abi in $(echo "$QT_ANDROID_ABIS" | tr ';' ' '); do
# Create arguments like: -DQT_PATH_ANDROID_ABI_arm64-v8a="/usr/lib/${QT_ANDROID_PACKAGE}-arm64-v8a"
Expand All @@ -164,9 +149,9 @@ jobs:
fi
echo "QT_PATH_ANDROID_ABI_$abi=${QT_INSTALL_PREFIX}" >> $GITHUB_ENV
# Add QT_PATH_CMAKE_DIR_ANDROID_ABI_%abi% (useful when android-build uses custom install dir) See QTBUG-106533
# Add QT_ANDROID_PATH_CMAKE_DIR_%abi% (useful when android-build uses custom install dir) See QTBUG-106533
QT_CMAKE_DIR="$(dirname "$(dirname "$(dpkg -S "qt.toolchain.cmake" | grep "${QT_ANDROID_PACKAGE}-${abi/x86_64/x86-64}:" | cut -f 2 -d " ")")")"
echo "QT_PATH_CMAKE_DIR_ANDROID_ABI_$abi=${QT_CMAKE_DIR}" >> $GITHUB_ENV
echo "QT_ANDROID_PATH_CMAKE_DIR_$abi=${QT_CMAKE_DIR}" >> $GITHUB_ENV
done &&
Expand Down Expand Up @@ -291,23 +276,22 @@ jobs:
-DQT_PATH_ANDROID_ABI_arm64-v8a="${{ env.QT_PATH_ANDROID_ABI_arm64-v8a }}" \
-DQT_PATH_ANDROID_ABI_x86="${{ env.QT_PATH_ANDROID_ABI_x86 }}" \
-DQT_PATH_ANDROID_ABI_x86_64="${{ env.QT_PATH_ANDROID_ABI_x86_64 }}" \
-DQT_PATH_CMAKE_DIR_ANDROID_ABI_armeabi-v7a="${{ env.QT_PATH_CMAKE_DIR_ANDROID_ABI_armeabi-v7a }}" \
-DQT_PATH_CMAKE_DIR_ANDROID_ABI_arm64-v8a="${{ env.QT_PATH_CMAKE_DIR_ANDROID_ABI_arm64-v8a }}" \
-DQT_PATH_CMAKE_DIR_ANDROID_ABI_x86="${{ env.QT_PATH_CMAKE_DIR_ANDROID_ABI_x86 }}" \
-DQT_PATH_CMAKE_DIR_ANDROID_ABI_x86_64="${{ env.QT_PATH_CMAKE_DIR_ANDROID_ABI_x86_64 }}" \
-DQT_ANDROID_PATH_CMAKE_DIR_armeabi-v7a="${{ env.QT_ANDROID_PATH_CMAKE_DIR_armeabi-v7a }}" \
-DQT_ANDROID_PATH_CMAKE_DIR_arm64-v8a="${{ env.QT_ANDROID_PATH_CMAKE_DIR_arm64-v8a }}" \
-DQT_ANDROID_PATH_CMAKE_DIR_x86="${{ env.QT_ANDROID_PATH_CMAKE_DIR_x86 }}" \
-DQT_ANDROID_PATH_CMAKE_DIR_x86_64="${{ env.QT_ANDROID_PATH_CMAKE_DIR_x86_64 }}" \
-DANDROID_SDK_ROOT=$MY_ANDROID_SDK_ROOT \
-DANDROID_NDK_ROOT=$MY_ANDROID_NDK_ROOT \
-DQT_ENABLE_VERBOSE_DEPLOYMENT=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
"${ARGS[@]}" \
-S .. -B .
- name: Build apk
id: build_apk
run: |
set -x
cd build
make VERBOSE=1 -j$(nproc) apk
cd ..
cmake --build "build" --parallel
ls -al build/android-build/build/outputs/apk/debug/android-build-debug.apk
- name: Upload to nightlies server
Expand All @@ -319,17 +303,41 @@ jobs:
sudo apt-get -y install sshpass
sshpass -p "${SFTP_PASSWORD}" scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null build/android-build/build/outputs/apk/debug/android-build-debug.apk "${SFTP_USER}"@welle-io-nightlies.albrechtloh.de:/welle-io-nightlies.albrechtloh.de/${DATE}_${LAST_COMMIT_HASH}_Android_welle-io.apk
- name: Build with qmake
id: build_apk_qmake
run: |
set -x
echo $PWD
mkdir -p qmake-build
cd qmake-build
${QT_INSTALL_BINDIR}/qmake \
../welle.io.pro
make V=1 apk
cd ..
ls -al qmake-build/src/welle-gui/android-build/build/outputs/apk/debug/android-build-debug.apk
- name: Archive artifacts (welle.io apk)
if: always() && steps.build_apk.outcome == 'success'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: welle.io apk
name: welle.io apk (for all android abi)
path: build/android-build/build/outputs/apk/debug/*.apk
if-no-files-found: error

- name: Archive artifacts (welle.io apk built by qmake)
if: always() && steps.build_apk_qmake.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: welle.io apk built by qmake (arm64-v8a only)
path: qmake-build/src/welle-gui/android-build/build/outputs/apk/debug/android-build-debug.apk
if-no-files-found: error

- name: Archive artifacts (welle.io build dir)
if: always() && steps.build_apk.outcome == 'failure'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: welle.io build dir
path: build/*
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- run: git fetch --prune --unshallow --tags

Expand All @@ -34,18 +34,26 @@ jobs:
run: env | sort

# qt6-charts-dev is not available in ubuntu 22.04, neither Debian bullseye.
# So we use the packages from Debian testing
- name: "Add Debian testing repo and required keys"
# So we use the packages from a newer repository
- name: "Add repo having qt6-charts-dev"
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 605C66F00D6C9793
sudo add-apt-repository "deb http://deb.debian.org/debian/ testing main" -y
if ! dpkg-query -W qt6-charts-dev; then
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ lunar main universe" -y
# Update packages list
sudo apt-get update -qq
fi
- name: Install build dependencies
run: set -x; sudo apt-get -y install build-essential cmake libairspy-dev libasound2-dev libfaad-dev libfftw3-dev libmp3lame-dev libmpg123-dev libpulse-dev libqt6opengl6-dev librtlsdr-dev libsoapysdr-dev qt6-base-dev qt6-declarative-dev qt6-multimedia-dev qt6-charts-dev
run: |
set -x
sudo apt-get -y install build-essential cmake libairspy-dev libasound2-dev libfaad-dev libfftw3-dev libmp3lame-dev libmpg123-dev libpulse-dev libqt6opengl6-dev librtlsdr-dev libsoapysdr-dev qt6-base-dev qt6-charts-dev qt6-declarative-dev qt6-multimedia-dev
# Workarounds for packaging bugs
if dpkg --compare-versions $(dpkg-query -W qt6-charts-dev | cut -d " " -f 2) lt 6.4.2-3; then
sudo apt-get -y install qml6-module-qtcharts
fi
if dpkg --compare-versions $(dpkg-query -W qt6-multimedia-dev | cut -d " " -f 2) lt 6.4.2-5; then
sudo apt-get -y install qml6-module-qtquick3d-spatialaudio
fi
- name: Configure welle.io project
run: |
Expand All @@ -66,7 +74,7 @@ jobs:
- name: Archive artifacts (welle.io build dir)
if: always() && steps.build.outcome == 'failure'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: welle.io build dir
path: build/*
Expand Down

0 comments on commit 8426077

Please sign in to comment.