1- # This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
2- # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
1+ # Build matrix: each platform job installs Qt, runs ./configure.sh (which
2+ # handles deps, qtapng, themes, cmake+ninja, and windeployqt on Windows),
3+ # then deploys + uploads.
34name : CI Build
45
56on :
2829 - uses : actions/checkout@master
2930 with :
3031 submodules : recursive
31-
32+
3233 - name : Install Qt
3334 uses : jurplel/install-qt-action@v4
3435 with :
@@ -37,75 +38,20 @@ jobs:
3738 arch : win64_mingw
3839 cache : true
3940 cache-key-prefix : install-qt-action
40- modules : ' qtimageformats qtwebsockets'
41+ modules : ' qtimageformats qtwebsockets qtmultimedia '
4142
42- - name : Install Windows Discord RPC
43- shell : bash
44- run : |
45- curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-win.zip -o discord_rpc.zip
46- unzip discord_rpc.zip
47- cp ./discord-rpc/win64-dynamic/lib/discord-rpc.lib ./lib/
48- cp ./discord-rpc/win64-dynamic/bin/discord-rpc.dll ./bin/
49- cp ./discord-rpc/win64-dynamic/include/discord*.h ./lib/
50-
51- - name : Install Windows BASS
43+ - name : Configure and build
5244 shell : bash
5345 run : |
54- curl http://www.un4seen.com/files/bass24.zip -o bass.zip
55- unzip -d bass -o bass.zip
56- cp ./bass/c/bass.h ./lib
57- cp ./bass/c/x64/bass.lib ./lib/
58- cp ./bass/x64/bass.dll ./bin/
59-
60- curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip
61- unzip -d bass -o bassopus.zip
62- cp ./bass/c/bassopus.h ./lib
63- cp ./bass/c/x64/bassopus.lib ./lib/
64- cp ./bass/x64/bassopus.dll ./bin/
65-
66- - name : Clone Apng plugin
67- uses : actions/checkout@master
68- with :
69- repository : jurplel/QtApng
70- path : ./qtapng
71-
72- - name : Build Apng plugin
73- run : |
74- cd ./qtapng
75- cmake . -G "MinGW Makefiles"
76- cmake --build . --config Release
77- mkdir -p ${{ github.workspace }}/bin/imageformats/
78- cp plugins/imageformats/qapng.dll ${{ github.workspace }}/bin/imageformats/qapng.dll
79-
80- - name : Build
81- run : |
82- cmake . -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=Release
83- cmake --build . --config Release
84-
85- - name : Deploy Windows
86- working-directory : ${{github.workspace}}/bin/
87- shell : bash
88- run : |
89- windeployqt --no-quick-import --no-translations --no-compiler-runtime --no-opengl-sw ./Attorney_Online.exe
90-
91- - name : Clone Themes
92- uses : actions/checkout@master
93- with :
94- repository : AttorneyOnline/AO2-Themes
95- path : " bin/base/themes"
96-
97- - name : Cleanup Themes Checkout
98- run : |
99- rm ./bin/base/themes/.gitignore
100- rm ./bin/base/themes/.gitattributes
101- Remove-Item -Path "./bin/base/themes/.git" -Recurse -Force
46+ QT_ROOT="$(cd "$QT_ROOT_DIR/../.." && pwd)"
47+ ./configure.sh QT_ROOT="$QT_ROOT" QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
10248
10349 - name : Upload Artifact
10450 uses : actions/upload-artifact@master
10551 with :
10652 name : Attorney_Online-Windows
107- path : ${{github.workspace}}/bin
108-
53+ path : ${{ github.workspace }}/bin
54+
10955 build-linux :
11056 needs : formatting-check
11157 runs-on : ubuntu-22.04
@@ -124,103 +70,52 @@ jobs:
12470 arch : ' gcc_64'
12571 cache : true
12672 cache-key-prefix : install-qt-action
127- modules : ' qtimageformats qtwebsockets'
128-
129- - name : Install Linux Discord RPC
130- run : |
131- curl -L https://github.com/discordapp/discord-rpc/releases/download/v3.4.0/discord-rpc-linux.zip -o discord_rpc.zip
132- unzip discord_rpc.zip
133- cp ./discord-rpc/linux-dynamic/lib/libdiscord-rpc.so ./lib/
134- cp ./discord-rpc/linux-dynamic/lib/libdiscord-rpc.so ./bin/
135- cp ./discord-rpc/linux-dynamic/include/discord*.h ./src/
136-
137- - name : Install Linux BASS
138- run : |
139- curl http://www.un4seen.com/files/bass24-linux.zip -o bass.zip
140- unzip -d bass -o bass.zip
141- cp ./bass/c/bass.h ./lib
142- cp ./bass/libs/x86_64/libbass.so ./lib/
143- cp ./bass/libs/x86_64/libbass.so ./bin/
144-
145- curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
146- unzip -d bass -o bassopus.zip
147- cp ./bass/c/bassopus.h ./lib
148- cp ./bass/libs/x86_64/libbassopus.so ./lib/
149- cp ./bass/libs/x86_64/libbassopus.so ./bin/
150-
151- - name : Clone Apng plugin
152- uses : actions/checkout@master
153- with :
154- repository : jurplel/QtApng
155- path : ./qtapng
156-
157- - name : Build Apng plugin
158- run : |
159- cd ./qtapng
160- cmake . -D CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE="${{ github.workspace }}/bin/imageformats/"
161- cmake --build . --config Release
73+ modules : ' qtimageformats qtwebsockets qtmultimedia'
16274
163- # install plugin
164- cp plugins/imageformats/libqapng.so ${QT_ROOT_DIR}/plugins/imageformats
75+ - name : Install system build tools
76+ run : sudo apt-get update && sudo apt-get install -y ninja-build patchelf libxcb-cursor0
16577
166- - name : Build
78+ - name : Configure and build
16779 run : |
168- cmake .
169- cmake --build . --config Release
170-
171- - name : Clone Themes
172- uses : actions/checkout@master
173- with :
174- repository : AttorneyOnline/AO2-Themes
175- path : " bin/base/themes"
80+ QT_ROOT="$(cd "$QT_ROOT_DIR/../.." && pwd)"
81+ ./configure.sh QT_ROOT="$QT_ROOT" QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
17682
177- - name : Cleanup Themes Checkout
83+ - name : Stage APNG plugin for AppImage
17884 run : |
179- rm ./bin/base/themes/.gitignore
180- rm ./bin/base/themes/.gitattributes
181- rm -r ./bin/base/themes/.git
85+ mkdir -p "$QT_ROOT_DIR/plugins/imageformats"
86+ cp qtapng/plugins/imageformats/libqapng.so "$QT_ROOT_DIR/plugins/imageformats/"
18287
183- - name : Deploy Linux
88+ - name : Package dynamic tarball
18489 shell : bash
18590 run : |
186- cd ${{ github.workspace }}/bin
187- mkdir ./imageformats
188- cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats
91+ cd "${{ github.workspace }}/bin"
18992 cp ../data/logo-client.png ./icon.png
19093 cp ../README_LINUX.md .
19194 cp ../scripts/DYNAMIC_INSTALL.sh ./INSTALL.sh
192- chmod +x INSTALL.sh
193- chmod +x Attorney_Online
194-
95+ chmod +x INSTALL.sh Attorney_Online
19596 patchelf --add-rpath . Attorney_Online
196-
19797 cd ..
19898 tar --transform='flags=r;s|bin|Attorney Online|' -cvf Attorney_Online-Dynamic.tar bin
19999
200- - name : Create AppImage
100+ - name : Build AppImage
201101 shell : bash
202102 run : |
203- # necessary, apparently
204- sudo apt install libxcb-cursor0
205103 # from https://github.com/probonopd/go-appimage/blob/master/src/appimagetool/README.md
206104 wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
207105 mv appimagetool-*-x86_64.AppImage appimagetool
208106 chmod +x appimagetool
209107
210- mkdir -p AppDir/usr/bin
211- mkdir -p AppDir/usr/lib/plugins/imageformats
212- mkdir -p AppDir/usr/share/applications
213-
108+ mkdir -p AppDir/usr/bin AppDir/usr/lib/plugins/imageformats AppDir/usr/share/applications
214109 cp bin/Attorney_Online AppDir/usr/bin
215- cp bin/lib*.so AppDir/usr/lib
110+ cp bin/lib*.so AppDir/usr/lib 2>/dev/null || true
216111 cp scripts/Attorney_Online.desktop AppDir/usr/share/applications
217112 cp data/logo-client.png AppDir/Attorney_Online.png
218113
219114 GIT_SHORT_SHA="${GITHUB_SHA::8}"
220- QTDIR=${ QT_ROOT_DIR} ./appimagetool deploy AppDir/usr/share/applications/Attorney_Online.desktop
115+ QTDIR="$ QT_ROOT_DIR" ./appimagetool deploy AppDir/usr/share/applications/Attorney_Online.desktop
221116 ARCH=x86_64 VERSION=${GIT_SHORT_SHA} ./appimagetool AppDir
222117
223- - name : Deploy AppImage
118+ - name : Package AppImage tarball
224119 shell : bash
225120 run : |
226121 mkdir bin-appimage
@@ -229,9 +124,7 @@ jobs:
229124 cp README_LINUX.md bin-appimage
230125 cp scripts/APPIMAGE_INSTALL.sh bin-appimage/INSTALL.sh
231126 cp Attorney_Online-*-x86_64.AppImage bin-appimage
232- chmod +x bin-appimage/INSTALL.sh
233- chmod +x bin-appimage/Attorney_Online-*-x86_64.AppImage
234-
127+ chmod +x bin-appimage/INSTALL.sh bin-appimage/Attorney_Online-*-x86_64.AppImage
235128 tar --transform='flags=r;s|bin-appimage|Attorney Online|' -cvf Attorney_Online-AppImage.tar bin-appimage
236129
237130 - name : Upload Dynamic Artifact
0 commit comments