From 3a53144bdbb2f92005a95029a999aa6771566fe5 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:56:46 +0700 Subject: [PATCH] CI/Appimage: Use fuse3 compatible appimagetool Backport from: https://github.com/stenzek/duckstation/pull/3251 Co-Authored-By: Samuel <36420837+samueru-sama@users.noreply.github.com> --- .github/workflows/linux_build_qt.yml | 2 ++ .../workflows/scripts/linux/appimage-qt.sh | 23 +++++++++++++++---- .../scripts/linux/pcsx2-qt.metainfo.xml.in | 15 +++++++++--- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux_build_qt.yml b/.github/workflows/linux_build_qt.yml index 62a7485925..c617a49b8c 100644 --- a/.github/workflows/linux_build_qt.yml +++ b/.github/workflows/linux_build_qt.yml @@ -68,6 +68,8 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # actions/checkout elides tags, fetch them primarily for releases - name: Fetch Tags diff --git a/.github/workflows/scripts/linux/appimage-qt.sh b/.github/workflows/scripts/linux/appimage-qt.sh index d7cb830b11..73839b2573 100755 --- a/.github/workflows/scripts/linux/appimage-qt.sh +++ b/.github/workflows/scripts/linux/appimage-qt.sh @@ -63,9 +63,9 @@ declare -a REMOVE_LIBS=( set -e -LINUXDEPLOY=./linuxdeploy-x86_64.AppImage -LINUXDEPLOY_PLUGIN_QT=./linuxdeploy-plugin-qt-x86_64.AppImage -APPIMAGETOOL=./appimagetool-x86_64.AppImage +LINUXDEPLOY=./linuxdeploy-x86_64 +LINUXDEPLOY_PLUGIN_QT=./linuxdeploy-plugin-qt-x86_64 +APPIMAGETOOL=./appimagetool-x86_64 PATCHELF=patchelf if [ ! -f "$LINUXDEPLOY" ]; then @@ -78,8 +78,11 @@ if [ ! -f "$LINUXDEPLOY_PLUGIN_QT" ]; then chmod +x "$LINUXDEPLOY_PLUGIN_QT" fi +# Using go-appimage +# Backported from https://github.com/stenzek/duckstation/pull/3251 if [ ! -f "$APPIMAGETOOL" ]; then - "$PCSX2DIR/tools/retry.sh" wget -O "$APPIMAGETOOL" https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage + APPIMAGETOOLURL=$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/[()",{} ]/\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$' | head -1) + "$PCSX2DIR/tools/retry.sh" wget -O "$APPIMAGETOOL" "$APPIMAGETOOLURL" chmod +x "$APPIMAGETOOL" fi @@ -199,6 +202,16 @@ for hookpath in "$SCRIPTDIR/apprun-hooks"/*; do done echo "Generating AppImage..." +GIT_VERSION=$(git tag --points-at HEAD) + +if [[ "${GIT_VERSION}" == "" ]]; then + # In the odd event that we run this script before the release gets tagged. + GIT_VERSION=$(git describe --tags) + if [[ "${GIT_VERSION}" == "" ]]; then + GIT_VERSION=$(git rev-parse HEAD) + fi +fi + rm -f "$NAME.AppImage" -$APPIMAGETOOL -v "$OUTDIR" "$NAME.AppImage" +ARCH=x86_64 VERSION="${GIT_VERSION}" "$APPIMAGETOOL" -s "$OUTDIR" && mv ./*.AppImage "$NAME.AppImage" diff --git a/.github/workflows/scripts/linux/pcsx2-qt.metainfo.xml.in b/.github/workflows/scripts/linux/pcsx2-qt.metainfo.xml.in index de845a8b8a..1e0dcbe479 100644 --- a/.github/workflows/scripts/linux/pcsx2-qt.metainfo.xml.in +++ b/.github/workflows/scripts/linux/pcsx2-qt.metainfo.xml.in @@ -18,14 +18,23 @@ https://pcsx2.net/docs/ https://pcsx2.net/discord https://crowdin.com/project/pcsx2-emulator - https://github.com/PCSX2/pcsx2 https://mastodon.social/@PCSX2 - https://raw.githubusercontent.com/PCSX2/pcsx2/master/.github/workflows/scripts/linux/flatpak/screenshots/screenshot1.png + + https://raw.githubusercontent.com/PCSX2/pcsx2/master/.github/workflows/scripts/linux/flatpak/screenshots/screenshot1.png + + + The main PCSX2 Qt interface + - https://raw.githubusercontent.com/PCSX2/pcsx2/master/.github/workflows/scripts/linux/flatpak/screenshots/screenshot2.png + + https://raw.githubusercontent.com/PCSX2/pcsx2/master/.github/workflows/scripts/linux/flatpak/screenshots/screenshot2.png + + + PCSX2 running a game +