Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci fixes / updates #143

Merged
merged 43 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
129d8f5
Update README.md
adam-ce Dec 22, 2024
18f5216
try fix android
adam-ce Dec 22, 2024
7429707
remove old wasm builds and try fix android again deploy.yml
adam-ce Dec 22, 2024
c028db5
refactor wasm ci: only use our own build of qt
adam-ce Dec 22, 2024
e1b4097
debug ci
adam-ce Dec 22, 2024
acbfefa
remove obsolete code in ci
adam-ce Dec 22, 2024
f6883b5
fix syntax (no split / join available)
adam-ce Dec 22, 2024
7312092
fix invalid workflow file: Job 'deploy' depends on unknown job 'build'
adam-ce Dec 22, 2024
ea2a2d5
fix git clone + fix QT_HOST_PATH
adam-ce Dec 22, 2024
49e28ad
try fix qt host path
adam-ce Dec 22, 2024
47203f6
debug android building
adam-ce Dec 22, 2024
6a7b7bd
try fix wasm single thread (st)
adam-ce Dec 23, 2024
9d64266
add wasm debug config
adam-ce Dec 23, 2024
61993cb
try fix debug wasm build
adam-ce Dec 23, 2024
657fb41
debug android building
adam-ce Dec 23, 2024
583b2ef
use cache for qt
adam-ce Dec 23, 2024
6af2068
debug android
adam-ce Dec 23, 2024
aae9a58
further debug android build
adam-ce Dec 23, 2024
0acc6c9
further try for android build
adam-ce Dec 23, 2024
87df8d1
try with extra host qt installation again
adam-ce Dec 23, 2024
77e86b9
fix arch
adam-ce Dec 23, 2024
39ecc66
fix debug output
adam-ce Dec 23, 2024
35db458
fix aqt version + debug output
adam-ce Dec 23, 2024
a285156
forgot debug output fix
adam-ce Dec 23, 2024
596c335
version bumps + debug output++
adam-ce Dec 23, 2024
f6af7a7
fix win compiler version
adam-ce Dec 23, 2024
774ab7d
fix jdk version
adam-ce Dec 24, 2024
b948c24
fix jdk version 2
adam-ce Dec 24, 2024
7b7b36f
fix jdk version 3
adam-ce Dec 24, 2024
6805b9d
fix jdk 4
adam-ce Dec 24, 2024
fe78050
fix jdk 5
adam-ce Dec 24, 2024
7a71356
clean up
adam-ce Dec 24, 2024
62896ad
clean up 2
adam-ce Dec 24, 2024
5d24bba
fix path to androiddeployqt
adam-ce Dec 24, 2024
8bc9128
debug wasm light build
adam-ce Dec 24, 2024
7b786e3
fix deploy
adam-ce Dec 24, 2024
5434a08
test parameter order for wasm build
adam-ce Dec 25, 2024
7e7dab4
Revert "test parameter order for wasm build"
adam-ce Dec 25, 2024
9887b96
try if wasm works when resetting everything
adam-ce Dec 25, 2024
715e211
Revert "try if wasm works when resetting everything"
adam-ce Dec 25, 2024
d59bc99
comment debug output + generate non lto for webassembly
adam-ce Dec 25, 2024
3e290c5
forgot to clear the cache
adam-ce Dec 25, 2024
6c75fdd
fix spelling
adam-ce Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 74 additions & 63 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,62 +16,52 @@ concurrency:
cancel-in-progress: true

jobs:
build:
build-android:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qtarch: [wasm_singlethread, wasm_multithread, android_arm64_v8a, android_armv7]
qtversion: ['6.6.1']
qtarch: [android_arm64_v8a, android_armv7]
include:
- qtarch: wasm_singlethread
qttarget: 'desktop'
qtmodules: ''
additional_build_flags: '--target install'
- qtarch: wasm_multithread
qttarget: 'desktop'
qtmodules: ''
additional_cmake_flags: '-DALP_ENABLE_THREADING=ON'
additional_build_flags: '--target install'
- qtarch: android_arm64_v8a
qttarget: 'android'
qtversion: '6.8.1'
qtmodules: 'qtcharts qtpositioning'
- qtarch: android_armv7
qttarget: 'android'
qtversion: '6.8.1'
qtmodules: 'qtcharts qtpositioning'

steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build
sudo apt-get install -y build-essential ninja-build openjdk-17-jdk
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/" >> $GITHUB_ENV
# dpkg-query -L openjdk-17-jdk-headless

- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- uses: mymindstorm/setup-emsdk@v13
if: matrix.qttarget == 'desktop'
with:
version: 3.1.37

- name: Install Qt native version (required by android version)
uses: jurplel/install-qt-action@v3
- name: Install Qt native version (the one provided by aqt doesn't seem to work)
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: ${{ matrix.qtversion }}
host: linux
host: 'linux'
target: 'desktop'
arch: gcc_64
arch: 'linux_gcc_64'
dir: '${{github.workspace}}/qt'
install-deps: 'true'
cache: true

- name: Set QT_HOST_PATH
run: echo "QT_HOST_PATH=${Qt6_DIR}" >> "$GITHUB_ENV"

- name: Set QT_HOST_ROOT_DIR
run: echo "QT_HOST_ROOT_DIR=${QT_ROOT_DIR}" >> "$GITHUB_ENV"
- name: Install Qt crosscompile target version
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: ${{ matrix.qtversion }}
Expand All @@ -81,14 +71,11 @@ jobs:
dir: '${{github.workspace}}/qt'
install-deps: 'true'
modules: ${{ matrix.qtmodules }}
cache: true

- name: Make qt cross binaries executable
run: |
chmod u+x ${Qt6_DIR}/bin/*

- name: Verify emcc
if: matrix.qttarget == 'desktop'
run: emcc -v
chmod u+x ${QT_ROOT_DIR}/bin/*

- name: Set reusable strings
shell: bash
Expand All @@ -102,18 +89,15 @@ jobs:
echo "APK_DIR=$BUILD_DIR/$APK_TARGET/android-build/build/outputs/apk/" >> $GITHUB_ENV
echo "ANDROID_BUILD_DIR=$BUILD_DIR/$APK_TARGET/android-build/" >> $GITHUB_ENV
echo "DEPLOYMENT_SETTINGS=$BUILD_DIR/$APK_TARGET/android-alpineapp-deployment-settings.json" >> $GITHUB_ENV

- name: Remove StatsWindow, otherwise the webassembly will link against qtwidgets and charts.
if: matrix.qttarget == 'desktop'
run: rm ./app/StatsWindow.qml

- name: Configure CMake
env:
CMAKE_PREFIX_PATH: ${{env.Qt6_DIR}}/lib/cmake
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}/lib/cmake
run: >
${Qt6_DIR}/bin/qt-cmake
${QT_ROOT_DIR}/bin/qt-cmake
-G Ninja
-B $BUILD_DIR
-DQT_HOST_PATH=${QT_HOST_ROOT_DIR}
-DCMAKE_BUILD_TYPE=Release
-DALP_WWW_INSTALL_DIR=$INSTALL_DIR
-DALP_ENABLE_ASSERTS=ON
Expand All @@ -131,15 +115,15 @@ jobs:
run: |
echo ${{ secrets.SIGNINGKEYBASE64 }} > release.keystore.base64
base64 -d release.keystore.base64 > release.keystore
$QT_HOST_PATH/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-33 --gradle --release --sign release.keystore alpinemaps --storepass ${{ secrets.KEYSTOREPASSWORD }}
$QT_HOST_ROOT_DIR/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-35 --gradle --release --sign release.keystore alpinemaps --storepass ${{ secrets.KEYSTOREPASSWORD }}

- name: Signing Android packages with generated key
env:
secret_test: ${{ secrets.KEYSTOREPASSWORD }}
if: matrix.qttarget == 'android' && env.secret_test == ''
run: |
keytool -genkey -v -keystore release.keystore -alias alpinemaps -keyalg RSA -sigalg SHA1withRSA -keysize 2048 -validity 10000 -keypass asdfasdf -storepass asdfasdf -dname "CN=Franz, OU=IT, O=Furz, L=Rattenberg, ST=Tirol, C=AT"
$QT_HOST_PATH/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-33 --gradle --release --sign release.keystore alpinemaps --storepass asdfasdf
$QT_HOST_ROOT_DIR/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-35 --gradle --release --sign release.keystore alpinemaps --storepass asdfasdf

README_PATH=$APK_DIR/read_me.txt
echo "The apk was signed with a generated key which changes every time the apk is generated. This means, that android might refuse to install it if another apk with the same app was installed previously. You'll have to deinstall it. Doing so will delete all settings and cache." >> $README_PATH
Expand Down Expand Up @@ -172,11 +156,39 @@ jobs:
if-no-files-found: error


build-wasm-release:
build-wasm:
runs-on: ubuntu-latest
env:
QT_VERSION: "6.8.0"
WEBASSEMBLY_VERSION: "3.1.56"
strategy:
fail-fast: false
matrix:
config: [wasm_mt, wasm_st]
include:
- config: wasm_mt_lto
qtflags: '-ltcg $(cat $QT_LITE_CONFIG) -feature-thread'
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=OFF'
qtversion: '6.8.1'
webassembly_version: "3.1.56"
- config: wasm_st_lto
qtflags: '-ltcg $(cat $QT_LITE_CONFIG) -no-feature-thread'
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=OFF'
qtversion: '6.8.1'
webassembly_version: "3.1.56"
- config: wasm_mt
qtflags: '$(cat $QT_LITE_CONFIG) -feature-thread'
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=OFF'
qtversion: '6.8.1'
webassembly_version: "3.1.56"
- config: wasm_st
qtflags: '-$(cat $QT_LITE_CONFIG) -no-feature-thread'
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=OFF'
qtversion: '6.8.1'
webassembly_version: "3.1.56"
- config: wasm_st_debug
qtflags: '-no-feature-thread'
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=ON'
qtversion: '6.8.1'
webassembly_version: "3.1.56"

steps:
- name: Install dependencies
run: |
Expand All @@ -190,26 +202,26 @@ jobs:

- uses: mymindstorm/setup-emsdk@v13
with:
version: ${{env.WEBASSEMBLY_VERSION}}
version: ${{matrix.webassembly_version}}

- name: Install Qt native version (required for cross building)
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: ${{env.QT_VERSION}}
version: ${{matrix.qtversion}}
host: linux
target: 'desktop'
arch: linux_gcc_64
dir: '${{github.workspace}}/qt_host'
install-deps: 'true'
modules: 'qtshadertools'
cache: true

- name: Set reusable strings
shell: bash
run: |
echo "QT_HOST_PATH=${QT_ROOT_DIR}" >> "$GITHUB_ENV"
echo "BUILD_DIR="$(pwd)/build"" >> $GITHUB_ENV
echo "INSTALL_DIR=install/wasm_release" >> $GITHUB_ENV
echo "INSTALL_DIR=install/${{ matrix.config}}" >> $GITHUB_ENV
echo "QT_WASM_ROOT_DIR=$(pwd)/qt_wasm_lite" >> $GITHUB_ENV
echo "QT_SRC_CONFIGURE=$(pwd)/qt_src/configure" >> $GITHUB_ENV
echo "QT_LITE_CONFIG=$(pwd)/misc/qt_lite.txt" >> $GITHUB_ENV
Expand All @@ -222,34 +234,37 @@ jobs:
uses: actions/cache@v4
with:
path: qt_wasm_lite
key: wasm-qt-${{ env.QT_VERSION }}-${{ env.WEBASSEMBLY_VERSION }}
key: ${{ matrix.config }}_qt-${{ matrix.qtversion }}_emcc-${{ matrix.webassembly_version }}

- name: Download and patch Qt
if: steps.qt-cache.outputs.cache-hit != 'true'
shell: bash
run: |
git clone --branch v$QT_VERSION git://code.qt.io/qt/qt5.git qt_src
git clone --branch v${{matrix.qtversion}} git://code.qt.io/qt/qt5.git qt_src
$QT_SRC_CONFIGURE -init-submodules -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats,qtsvg
cd qt_src/qtbase
git apply ../../misc/qt_68_qtbase_remove_dejavu_fonts.patch

- name: Build Qt for Webassembly (custom lightweight LTO version)
- name: Build Qt for Webassembly (custom version)
if: steps.qt-cache.outputs.cache-hit != 'true'
shell: bash
run: |
dest_dir="${{env.QT_WASM_ROOT_DIR}}"
mkdir qt_wasm_build
cd qt_wasm_build
${{env.QT_SRC_CONFIGURE}} -qt-host-path $QT_HOST_PATH -release -ltcg $(cat ${{env.QT_LITE_CONFIG}}) -prefix "${QT_WASM_ROOT_DIR}/"
${{env.QT_SRC_CONFIGURE}} -qt-host-path $QT_ROOT_DIR -release -optimize-size -platform wasm-emscripten -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats,qtsvg -make libs -gui ${{ matrix.qtflags }} -prefix "${QT_WASM_ROOT_DIR}/"
# cat ./build.ninja
sed -i 's/-flto=thin/-flto/g' ./build.ninja
# echo "=============================================================================================================================================="
# cat ./build.ninja
cmake --build . --parallel && cmake --install .
# Fail if the directory is not created or is empty
[ -d "$QT_WASM_ROOT_DIR" ] && [ "$(ls -A $QT_WASM_ROOT_DIR)" ] || exit 1

- name: Remove StatsWindow, otherwise the webassembly will link against qtwidgets and charts.
run: rm ./app/StatsWindow.qml

- name: Configure CMake
- name: Configure
env:
CMAKE_PREFIX_PATH: ${{env.Qt6_DIR}}/lib/cmake
run: >
Expand All @@ -258,10 +273,9 @@ jobs:
-B $BUILD_DIR
-DCMAKE_BUILD_TYPE=MinSizeRel
-DALP_WWW_INSTALL_DIR=$INSTALL_DIR
-DALP_ENABLE_ASSERTS=OFF
-DALP_ENABLE_LTO=ON
-DFMT_INSTALL=OFF
-DALP_ENABLE_THREADING=ON
${{ matrix.cmakeflags }}
-S ${{ github.workspace }}

- name: Build
Expand All @@ -270,15 +284,15 @@ jobs:
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: files_wasm_release
name: files_${{ matrix.config}}
path: ${{ github.workspace }}/install/
if-no-files-found: error

deploy:
if: github.event_name == 'push'
needs:
- build
- build-wasm-release
- build-android
- build-wasm
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down Expand Up @@ -318,17 +332,14 @@ jobs:
mirror -R -e -v -n $GITHUB_WORKSPACE/github_page/. ./${reponame}_$(git describe --tags --dirty=-d --abbrev=1);
"

- name: Fix headers for wasm_multithread
- name: Fix headers for wasm multithread
run: |
cd $GITHUB_WORKSPACE/github_page/wasm_multithread
cd $GITHUB_WORKSPACE/github_page/wasm_mt_lto
wget https://raw.githubusercontent.com/gzuidhof/coi-serviceworker/master/coi-serviceworker.min.js
sed -i -e 's#<body onload="init()">#<body onload="init()"><script src="coi-serviceworker\.min\.js"></script>#g' alpineapp.html

- name: Fix headers for wasm_release
run: |
cd $GITHUB_WORKSPACE/github_page/wasm_release
cd $GITHUB_WORKSPACE/github_page/wasm_mt
wget https://raw.githubusercontent.com/gzuidhof/coi-serviceworker/master/coi-serviceworker.min.js
cp alpineapp.html alpineapp_orig.html
sed -i -e 's#<body onload="init()">#<body onload="init()"><script src="coi-serviceworker\.min\.js"></script>#g' alpineapp.html

- name: Generate Directory Listings
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,33 @@ jobs:
sudo apt-get install -y build-essential ninja-build lld clang-15 libgl1-mesa-dev libxcb-cursor-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0

- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.6.1'
version: '6.8.1'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
arch: 'linux_gcc_64'
dir: '${{github.workspace}}/qt'
install-deps: 'true'
modules: 'qtcharts qtpositioning'

cache: true

- name: Debug output
shell: bash
run: |
echo "${{github.workspace}}/qt/Qt/6.8.1":
ls ${{github.workspace}}/qt/Qt/6.8.1
echo "==="
echo "${QT_ROOT_DIR}/lib/cmake/Qt6Linguist:"
ls ${QT_ROOT_DIR}/lib/cmake/Qt6Linguist
echo "==="

- name: Configure
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}/lib/cmake
run: >
cmake -G Ninja
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,21 @@ jobs:
mklink libglapi.dll "x64\libglapi.dll"

- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.6.1'
version: '6.8.1'
host: windows
target: 'desktop'
arch: 'win64_msvc2019_64'
arch: 'win64_msvc2022_64'
dir: '${{github.workspace}}/qt'
install-deps: 'true'
modules: 'qtcharts qtpositioning'
cache: true

- name: Configure
env:
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}/lib/cmake
run: >
cmake -G Ninja
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ We use Qt Creator (with mingw on Windows), which is the only tested setup atm an
* Qt Positioning and Charts modules
* Some other dependencies will be pulled automatically during building.

## Building the native version
* just run cmake and build

## Building the android version
* We are usually building with Qt Creator, because it works relatively out of the box. However, it should also work on the command line or other IDEs if you set it up correctly.
* You need a Java JDK before you can do anything else. Not all Java versions work, and the error messages might be surprising (or non-existant). I'm running with Java 19, and I can compile for old devices. Iirc a newer version of Java caused issues. [Android documents the required Java version](https://developer.android.com/build/jdks), but as said, for me Java 19 works as well. It might change in the future.
Expand Down
Loading
Loading