1+ # Author: Kang Lin <kl222@126.com>
2+
13name : appimage
24
35on :
@@ -16,19 +18,27 @@ jobs:
1618 matrix :
1719 BUILD_TYPE : [Release]
1820 qt_version : [6.8.2]
19- qt_arch : [linux_gcc_64]
20-
21- # See: https://docs.github.com/zh/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
21+ os : [ubuntu-24.04, ubuntu-24.04-arm]
22+ include :
23+ - os : ubuntu-24.04
24+ qt_arch : " linux_gcc_64"
25+ - os : ubuntu-24.04-arm
26+ qt_arch : " linux_gcc_arm64"
27+
28+ # See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
29+ # See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
2230 # See: https://github.com/actions/runner-images/
23- runs-on : ubuntu-24.04
31+ runs-on : ${{matrix.os}}
2432
2533 env :
2634 BUILD_TYPE : ${{matrix.BUILD_TYPE}}
35+ BUILD_DIR : ${{github.workspace}}/build
2736 SOURCE_DIR : ${{github.workspace}}/.cache/source
28- TOOSL_DIR : ${{github.workspace}}/.cache/tools
29- INSTALL_DIR : ${{github.workspace}}/.cache/install
37+ TOOLS_DIR : ${{github.workspace}}/.cache/tools
38+ INSTALL_DIR : ${{github.workspace}}/.cache/install_${{matrix.os}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}}
39+ artifact_name : build_appimage_${{matrix.os}}
40+ qt_modules : ' qtscxml'
3041 SerialPortAssistant_VERSION : v0.5.29
31- artifact_name : build_appimage
3242
3343 # Map the job outputs to step outputs
3444 outputs :
@@ -38,118 +48,72 @@ jobs:
3848 - name : Checkout Repository
3949 uses : actions/checkout@v3
4050 with :
41- submodules : true
51+ submodules : recursive
4252
4353 - name : Make directories
4454 run : |
45- cmake -E make_directory ${{github.workspace}}/build
55+ cmake -E make_directory ${{env.BUILD_DIR}}
4656 cmake -E make_directory ${{env.SOURCE_DIR}}
47- cmake -E make_directory ${{env.TOOSL_DIR }}
57+ cmake -E make_directory ${{env.TOOLS_DIR }}
4858 cmake -E make_directory ${{env.INSTALL_DIR}}
4959
60+ - name : Cache installed
61+ uses : actions/cache@v3
62+ id : cache-installed
63+ with :
64+ path : |
65+ ${{env.INSTALL_DIR}}
66+ ${{env.TOOLS_DIR}}/linuxdeploy-*
67+ key : install_appimage
68+
5069 - name : git clone RabbitCommon
5170 working-directory : ${{env.SOURCE_DIR}}
5271 run : |
5372 git clone https://github.com/KangLin/RabbitCommon.git
5473
55- - name : Install apt packages
74+ - name : Install base dependency libraries
5675 run : |
57- sudo apt-get update -y
58- sudo apt-get upgrade -y
59- sudo apt install -y -q cmake build-essential xvfb xpra \
60- libgl1-mesa-dev libglx-dev libglu1-mesa-dev libvulkan-dev \
61- cmake debhelper fakeroot graphviz \
62- libxkbcommon-dev libxkbcommon-x11-dev xorg-dev libx11-xcb-dev \
63- libx11-dev libxfixes-dev libxcb-randr0-dev libxcb-shm0-dev \
64- libxcb-xinerama0-dev libxcb-composite0-dev libxcomposite-dev \
65- libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev \
66- libxcb-cursor-dev libxcb-xkb-dev libxcb-keysyms1-dev \
67- libxcb-* libxcb-cursor0 \
68- libwayland-dev libwayland-egl-backend-dev waylandpp-dev \
69- libxkbcommon-dev mesa-common-dev \
70- libcmark-dev cmark libfuse-dev libfuse3-dev
76+ sudo ./Script/build_depend.sh --apt_update --base --default \
77+ --install ${{env.INSTALL_DIR}} \
78+ --source ${{env.SOURCE_DIR}} \
79+ --tools ${{env.TOOLS_DIR}} \
80+ --build ${{env.BUILD_DIR}}
7181
7282 - name : Install Qt
7383 uses : jurplel/install-qt-action@v3
84+ if : false
7485 with :
75- dir : ' ${{env.TOOSL_DIR}}/qt'
76- aqtversion : ' ==3.1.*'
86+ dir : ' ${{env.TOOLS_DIR}}/qt'
7787 version : ${{matrix.qt_version}}
78- host : ' linux'
7988 target : ' desktop'
8089 arch : ${{matrix.qt_arch}}
8190 # See: https://ddalcino.github.io/aqt-list-server/
82- modules : ' qtscxml qtmultimedia qtimageformats qtserialport qt5compat '
91+ modules : ${{env.qt_modules}}
8392 cache : true
84- cache-key-prefix : cached-qt
85-
86- - name : Cache installed
87- uses : actions/cache@v3
88- id : cache-installed
89- with :
90- path : |
91- ${{env.INSTALL_DIR}}
92- ${{env.TOOSL_DIR}}
93- key : install_ubuntu_${{matrix.BUILD_TYPE}}
94-
95- - name : linuxdeploy
96- run : |
97- cd ${{env.TOOSL_DIR}}
98- if [ ! -f linuxdeploy-`uname -m`.AppImage ]; then
99- wget https://github.com/linuxdeploy/linuxdeploy/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-`uname -m`.AppImage
100- chmod u+x linuxdeploy-`uname -m`.AppImage
101- fi
102- if [ ! -f linuxdeploy-plugin-qt-`uname -m`.AppImage ]; then
103- wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/2.0.0-alpha-1-20241106/linuxdeploy-plugin-qt-`uname -m`.AppImage
104- chmod u+x linuxdeploy-plugin-qt-`uname -m`.AppImage
105- fi
93+ cache-key-prefix : cached-qt_${{matrix.qt_arch}}
10694
10795 - name : build appimage
108- working-directory : ${{github.workspace}}/build
10996 env :
11097 RabbitCommon_ROOT : ${{env.SOURCE_DIR}}/RabbitCommon
11198 run : |
112- cmake ${{github.workspace}} \
113- -DCMARK_SHARED=OFF \
114- -DCMARK_TESTS=OFF \
115- -DCMARK_STATIC=ON \
116- -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} \
117- -DCMAKE_INSTALL_PREFIX=/usr
118- cmake --build . --parallel $(nproc)
119- cmake --install . --config Release --component DependLibraries --prefix AppDir/usr
120- cmake --install . --config Release --component Runtime --prefix AppDir/usr
121- cmake --install . --config Release --component Application --prefix AppDir/usr
122- # See: https://github.com/linuxdeploy/linuxdeploy-plugin-qt
123- export QMAKE=$Qt6_DIR/bin/qmake
124- export EXTRA_PLATFORM_PLUGINS="libqxcb.so"
125- # Icons from theme are not displayed in QtWidgets Application: https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/17
126- export EXTRA_QT_MODULES="svg"
127- ${{env.TOOSL_DIR}}/linuxdeploy-`uname -m`.AppImage --appdir=AppDir -v0 \
128- --deploy-deps-only=AppDir/usr/lib/`uname -m`-linux-gnu \
129- --plugin qt \
130- --output appimage
131- mv Serial_Port_Assistant-`uname -m`.AppImage ../SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.AppImage
132- chmod a+x ../SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.AppImage
133- md5sum ../SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.AppImage > ../SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.AppImage.md5sum
99+ export QMAKE=/usr/bin/qmake6
100+ ${{github.workspace}}/Script/build_appimage.sh
101+ md5sum SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.AppImage > ../SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_`uname -m`.AppImage.md5sum
134102
135103 - name : update configure file
136104 if : ${{ matrix.BUILD_TYPE == 'Release'}}
137105 # continue-on-error: true
138106 run : |
139107 #sudo apt update -y -qq
140108 #sudo apt-get install -y -qq xvfb xpra
141- sudo Xvfb :99 -ac &
142- export DISPLAY=:99 .0
109+ sudo Xvfb :96 -ac -screen 0 1200x900x24 &
110+ export DISPLAY=:96 .0
143111 echo "Update update_linux.json ......"
144112 export QT_XCB_GL_INTEGRATION=none
145- export QT_DEBUG_PLUGINS=1
113+ # export QT_DEBUG_PLUGINS=1
146114 ARCH=`uname -m`
147115 MD5SUM=`cat SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_$ARCH.AppImage.md5sum|awk '{print $1}'`
148116 echo "MD5SUM SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_$ARCH.AppImage: ${MD5SUM}"
149- #echo "Enable core dump ......"
150- #ulimit -c unlimited
151- #echo "# sudo sysctl -w kernel.core_pattern=core"
152- #sudo sysctl -w kernel.core_pattern=${{github.workspace}}/core
153117 echo "Generate update configure file ......"
154118 ./SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_$ARCH.AppImage \
155119 -f "${{github.workspace}}/update_appimage_${{matrix.qt_arch}}_qt${{matrix.qt_version}}.json" \
0 commit comments