From f91be6b99cf113923f1c4ff1a7a60df81af15317 Mon Sep 17 00:00:00 2001 From: lambdcalculus <64238778+lambdcalculus@users.noreply.github.com> Date: Sun, 7 Jul 2024 17:26:56 -0300 Subject: [PATCH] Add AppImage CI build (#1005) * add AppImage CI build * specify ubuntu 22.04 LTS in CI * change +x bit * use tar to preserve permissions * make folder names nicer in the tar * clone themes before making tar archive --------- Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com> --- .github/workflows/build.yml | 74 ++++++++++++++++++++++++++------- README_LINUX.md | 26 ++++++++++++ scripts/Attorney_Online.desktop | 7 ++++ 3 files changed, 92 insertions(+), 15 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 b0fd027..228a76f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -109,14 +109,14 @@ jobs: build-linux: needs: formatting-check - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@master with: 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' @@ -161,21 +161,14 @@ 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 . cmake --build . --config Release - - name: Deploy Linux - shell: bash - run: | - cd ${{ github.workspace }}/bin - mkdir ./imageformats - cp ../qtapng/plugins/imageformats/libqapng.so ./imageformats - cp ../scripts/launch.sh . - chmod +x launch.sh - chmod +x Attorney_Online - - name: Clone Themes uses: actions/checkout@master with: @@ -188,8 +181,59 @@ jobs: rm ./bin/base/themes/.gitattributes rm -r ./bin/base/themes/.git - - name: Upload Artifact + - name: Deploy Linux + shell: bash + run: | + cd ${{ github.workspace }}/bin + 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 + + cd .. + tar --transform='flags=r;s|bin|Attorney_Online|' -cvf Attorney_Online-Dynamic.tar bin + + - 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 + + mkdir bin-appimage + cp -r bin/base bin-appimage + cp README_LINUX.md bin-appimage + cp Attorney_Online-*-x86_64.AppImage bin-appimage + chmod +x bin-appimage/Attorney_Online-*-x86_64.AppImage + + tar -cvf Attorney_Online-AppImage.tar bin-appimage/* + tar --transform='flags=r;s|bin-appimage|Attorney_Online|' -cvf Attorney_Online-AppImage.tar bin-appimage + + - name: Upload Dynamic Artifact uses: actions/upload-artifact@master with: - name: Attorney_Online-Linux - path: ${{github.workspace}}/bin + name: Attorney_Online-Linux-Dynamic + path: Attorney_Online-Dynamic.tar + + - name: Upload AppImage Artifact + uses: actions/upload-artifact@master + with: + name: Attorney_Online-Linux-AppImage + path: Attorney_Online-AppImage.tar diff --git a/README_LINUX.md b/README_LINUX.md new file mode 100644 index 0000000..04a537f --- /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 might only run on newer systems. The AppImage is a bit bigger, but should run seamlessly on most systems (anything newer than Ubuntu 22.04 LTS). + +### 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 0000000..16ed600 --- /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;