From 5cf2aa1388843ada1f0a18896a765add0adf4338 Mon Sep 17 00:00:00 2001 From: lambdcalculus Date: Mon, 1 Jul 2024 20:33:39 -0300 Subject: [PATCH] add AppImage CI build --- .github/workflows/build.yml | 44 ++++++++++++++++++++++++++++++--- README_LINUX.md | 26 +++++++++++++++++++ scripts/Attorney_Online.desktop | 7 ++++++ 3 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 README_LINUX.md create mode 100644 scripts/Attorney_Online.desktop diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93f18fd9f..8b59acb95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,7 +122,7 @@ jobs: submodules: recursive - name: Install Qt - uses: jurplel/install-qt-action@v3 + uses: jurplel/install-qt-action@v4 with: aqtversion: '==3.1.*' version: '6.5.3' @@ -173,6 +173,9 @@ jobs: cmake . -D CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE="${{ github.workspace }}/bin/imageformats/" cmake --build . --config Release + # install plugin + cp plugins/imageformats/libqapng.so ${QT_ROOT_DIR}/plugins/imageformats + - name: Build run: | cmake . @@ -185,6 +188,7 @@ jobs: mkdir ./imageformats cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats cp ../scripts/launch.sh . + cp ../README_LINUX.md . chmod +x launch.sh chmod +x Attorney_Online @@ -200,8 +204,42 @@ jobs: rm ./bin/base/themes/.gitattributes rm -r ./bin/base/themes/.git - - name: Upload Artifact + - name: Create AppImage + shell: bash + run: | + # necessary, apparently + sudo apt install libxcb-cursor0 + # from https://github.com/probonopd/go-appimage/blob/master/src/appimagetool/README.md + 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) + mv appimagetool-*-x86_64.AppImage appimagetool + chmod +x appimagetool + + mkdir -p AppDir/usr/bin + mkdir -p AppDir/usr/lib/plugins/imageformats + mkdir -p AppDir/usr/share/applications + + cp bin/Attorney_Online AppDir/usr/bin + cp bin/lib*.so AppDir/usr/lib + cp scripts/Attorney_Online.desktop AppDir/usr/share/applications + cp data/logo-client.png AppDir/Attorney_Online.png + + QTDIR=${QT_ROOT_DIR} ./appimagetool deploy AppDir/usr/share/applications/Attorney_Online.desktop + ARCH=x86_64 VERSION=2.11 ./appimagetool AppDir + chmod +x Attorney_Online-*-x86_64.AppImage + + mkdir bin-appimage + cp -r bin/base bin-appimage + cp Attorney_Online-*-x86_64.AppImage bin-appimage + cp README_LINUX.md bin-appimage + + - name: Upload Dynamic Artifact uses: actions/upload-artifact@master with: - name: Attorney_Online-Linux + name: Attorney_Online-Linux-Dynamic path: ${{github.workspace}}/bin + + - name: Upload AppImage Artifact + uses: actions/upload-artifact@master + with: + name: Attorney_Online-Linux-AppImage + path: ${{github.workspace}}/bin-appimage diff --git a/README_LINUX.md b/README_LINUX.md new file mode 100644 index 000000000..b70e0319b --- /dev/null +++ b/README_LINUX.md @@ -0,0 +1,26 @@ +## Running on Linux + +There are two download options for running on Linux: the **dynamically-linked** build and the **AppImage**. The dynamic build is lighter, but may not run on older systems. The AppImage is a bit bigger, but should seamlessly on most systems. + +### AppImage + +If you downloaded the **AppImage** version, it should just be plug-and-play. If you run into errors or bugs, contact us in our [Discord server](https://discord.gg/wWvQ3pw) or open an [issue on Github](https://github.com/AttorneyOnline/AO2-Client/issues). + +### Dynamic + +If you downloaded the **dynamically-linked** version, use the `launch.sh` script to run AO. + +You may need to install some libraries in your system. These are the commands to run on a terminal for some distributions: + +* Arch Linux: +``` +$ sudo pacman -S qt6-base qt6-tools qt6-websockets qt6-imageformats +``` +* Fedora: +``` +$ sudo dnf install qt6-qtbase qt6-qttools qt6-qtwebsockets qt6-qtimageformats +``` +* Ubuntu 22.04 LTS: +``` +$ sudo apt-get install qt6base-dev libqt6uitools6 libqt6websockets6 qt6-image-formats-plugins +``` diff --git a/scripts/Attorney_Online.desktop b/scripts/Attorney_Online.desktop new file mode 100644 index 000000000..16ed60029 --- /dev/null +++ b/scripts/Attorney_Online.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Attorney Online +Comment=The courtroom drama simulator +Exec=Attorney_Online +Icon=Attorney_Online +Categories=Game;