1313
1414jobs :
1515 build :
16- runs-on : ubuntu-latest
17- env :
18- LAZBUILD_WITH_PATH : lazbuild
19- RELEASE_FILE_NAME : trackereditor_linux_amd64.AppImage
20- LAZ_OPT : --widgetset=qt5
16+ runs-on : ubuntu-24.04 # ubuntu-latest
17+
18+ env : # Use the latest Lazarus source code.
19+ LAZARUS_URL_TAR_GZ : " https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%203.6/lazarus-3.6-0.tar.gz"
20+
21+ strategy :
22+ # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
23+ fail-fast : false
24+
25+ # Set up an include to perform the following build configurations.
26+ matrix :
27+ include :
28+ - BUILD_TARGET : gtk2_amd64
29+ RELEASE_FILE_NAME : trackereditor_linux_amd64_gtk2.zip
30+ LAZ_OPT : --widgetset=gtk2
31+
32+ - BUILD_TARGET : qt5_amd64
33+ RELEASE_FILE_NAME : trackereditor_linux_amd64_qt5.zip
34+ LAZ_OPT : --widgetset=qt5
35+ QT_VERSION_CI : ' 5'
36+
37+ - BUILD_TARGET : qt6_amd64
38+ RELEASE_FILE_NAME : trackereditor_linux_amd64_qt6.zip
39+ LAZ_OPT : --widgetset=qt6
40+ QT_VERSION_CI : ' 6'
41+
42+ - BUILD_TARGET : AppImage_amd64
43+ RELEASE_FILE_NAME : trackereditor_linux_amd64_qt6.AppImage
44+ LAZ_OPT : --widgetset=qt6
45+ QT_VERSION_CI : ' 6'
2146
2247 steps :
2348 - uses : actions/checkout@v4
2449
25- - name : Install dependency
26- run : sudo apt-get install -y lazarus fpc fuse xvfb libqt5pas-dev qt5-qmake qtwayland5 qt5-gtk-platformtheme libqt5svg5
50+ - name : Install dependency for all build
51+ run : sudo apt-get install -y fpc xvfb
2752 shell : bash
2853
29- - name : Build Release version
30- # Build trackereditor project (Release mode)
31- run : ${{ env.LAZBUILD_WITH_PATH }} --build-all --build-mode=Release ${{ env.LAZ_OPT }} source/project/tracker_editor/trackereditor.lpi
54+ - name : Install dependency for gtk2
55+ if : matrix.QT_VERSION_CI == ''
56+ run : sudo apt-get install -y libgtk2.0-dev
3257 shell : bash
3358
34- - name : Test OpenSSL works on Linux CI
35- run : xvfb-run --auto-servernum enduser/trackereditor -TEST_SSL
59+ - name : Install dependency for qt5
60+ if : matrix.QT_VERSION_CI == '5'
61+ run : sudo apt-get install -y libqt5x11extras5-dev
3662 shell : bash
3763
38- - name : Download linuxdeploy
39- # Use static versions of AppImage builder. So it won't depend on some specific OS image or library version.
40- run : |
64+ - name : Install dependency for qt6
65+ if : matrix.QT_VERSION_CI == '6'
66+ run : sudo apt-get install -y qt6-base-dev
67+ shell : bash
68+
69+ - name : Install dependency for AppImage
70+ if : matrix.BUILD_TARGET == 'AppImage_amd64'
71+ run : |
72+ # Add wayland plugin and platform theme
73+ sudo apt-get install -y fuse qt6-wayland qt6-xdgdesktopportal-platformtheme qt6-gtk-platformtheme
74+ # Use static versions of AppImage builder. So it won't depend on some specific OS image or library version.
4175 curl -L -O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-static-x86_64.AppImage
4276 curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-static-x86_64.AppImage
4377 curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
4478 chmod +x linuxdeploy-*.AppImage
4579 shell : bash
4680
81+ - name : Download Lazarus source code
82+ run : |
83+ #Download lazarus source code. Directory 'lazarus' will be created in the project folder.
84+ curl -L -O ${{ env.LAZARUS_URL_TAR_GZ }}
85+ tar -xzf *.tar.gz
86+ shell : bash
87+
88+ - name : Build libQTpas.so
89+ if : matrix.QT_VERSION_CI != ''
90+ run : |
91+ cd "${{ github.workspace }}/lazarus/lcl/interfaces/qt${{ matrix.QT_VERSION_CI }}/cbindings/"
92+ /usr/lib/qt${{ matrix.QT_VERSION_CI }}/bin/qmake
93+ make -j$(nproc)
94+ sudo make install
95+ shell : bash
96+
97+ - name : Build lazbuild
98+ env :
99+ LAZARUS_DIR : " ${{ github.workspace }}/lazarus"
100+ run : |
101+ # make lazbuild and put the link with extra parameter in project folder
102+ cd "$LAZARUS_DIR"
103+ make lazbuild
104+ echo "$LAZARUS_DIR/lazbuild --primary-config-path=$LAZARUS_DIR --lazarusdir=$LAZARUS_DIR \$*" > ${{ github.workspace }}/lazbuild
105+ chmod +x ${{ github.workspace }}/lazbuild
106+ shell : bash
107+
108+ - name : Build trackereditor
109+ # Build trackereditor project (Release mode)
110+ run : ./lazbuild --build-all --build-mode=Release ${{ matrix.LAZ_OPT }} source/project/tracker_editor/trackereditor.lpi
111+ shell : bash
112+
113+ - name : Test if OpenSSL works on Linux CI
114+ run : xvfb-run --auto-servernum enduser/trackereditor -TEST_SSL
115+ shell : bash
116+
117+ - name : Copy libQtpas.so before releasing the Qt5/Qt6 zip file format.
118+ if : matrix.BUILD_TARGET == 'qt5_amd64' || matrix.BUILD_TARGET == 'qt6_amd64'
119+ run : |
120+ cp -av /usr/lib/*/libQt?Pas.* ${{ github.workspace }}/enduser
121+ cat <<EOF > ${{ github.workspace }}/enduser/missing_libQtPas.so.txt
122+ Start program with:
123+ env LD_LIBRARY_PATH=. ./trackereditor
124+
125+ This uses libQtpas.so, which is necessary for this program.
126+ Some Linux OS stores may also offer this libQtpas.so
127+ https://archlinux.org/packages/extra/x86_64/qt5pas/
128+ https://archlinux.org/packages/extra/x86_64/qt6pas/
129+ EOF
130+ shell : bash
131+
132+ - name : Create a gtk2 or Qt5/Qt6 release in zip file format.
133+ if : matrix.BUILD_TARGET != 'AppImage_amd64'
134+ run : zip -j ${{ matrix.RELEASE_FILE_NAME }} enduser/*.txt enduser/libQt* enduser/trackereditor
135+ shell : bash
136+
47137 - name : Create AppImage
138+ if : matrix.BUILD_TARGET == 'AppImage_amd64'
48139 # NO_STRIP: true => or else warning: qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
49140 # LDAI_NO_APPSTREAM=1: skip checking AppStream metadata for issues
50141 env :
51- NO_STRIP : true
142+ # NO_STRIP: true
52143 LDAI_NO_APPSTREAM : 1
53- LDAI_OUTPUT : ${{ env.RELEASE_FILE_NAME }}
144+ LDAI_OUTPUT : ${{ matrix.RELEASE_FILE_NAME }}
145+ QMAKE : /usr/lib/qt${{ matrix.QT_VERSION_CI }}/bin/qmake
146+ EXTRA_QT_MODULES : waylandcompositor
147+ EXTRA_PLATFORM_PLUGINS : libqwayland-generic.so;libqwayland-egl.so
148+ DEPLOY_PLATFORM_THEMES : true
54149 run : |
55150 ./linuxdeploy-static-x86_64.AppImage \
56151 --output appimage \
@@ -64,13 +159,13 @@ jobs:
64159 - name : Upload Artifact
65160 uses : actions/upload-artifact@v4
66161 with :
67- name : artifact-${{ runner.os }}
68- path : ${{ env .RELEASE_FILE_NAME }}
162+ name : artifact-${{ matrix.RELEASE_FILE_NAME }}
163+ path : ${{ matrix .RELEASE_FILE_NAME }}
69164 compression-level : 0 # no compression. Content is already a compress file
70165 if-no-files-found : error
71166
72167 - name : File release to end user
73168 uses : softprops/action-gh-release@v2
74169 if : startsWith(github.ref, 'refs/tags/')
75170 with :
76- files : ${{ env .RELEASE_FILE_NAME }}
171+ files : ${{ matrix .RELEASE_FILE_NAME }}
0 commit comments