From 7272dbf097f9ffe089200a0d7e9b2ff5a3c0a809 Mon Sep 17 00:00:00 2001 From: Piplup Date: Mon, 21 Oct 2024 15:53:33 +0100 Subject: [PATCH 1/9] idk if this will work --- .github/workflows/build.yml | 30 +++++++++++++++ .github/workflows/release.yml | 37 +++++++++++++++++++ distribution/linux/appimage/AppRun | 3 ++ distribution/linux/appimage/build-appimage.sh | 30 +++++++++++++++ 4 files changed, 100 insertions(+) create mode 100755 distribution/linux/appimage/AppRun create mode 100755 distribution/linux/appimage/build-appimage.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d90d4df2..94a62c0ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,36 @@ jobs: chmod +x ./publish_sdl2_headless/Ryujinx.Headless.SDL2 ./publish_sdl2_headless/Ryujinx.sh if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest' + - name: Build AppImage + if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest' + run: | + PLATFORM_NAME="${{ matrix.platform.name }}" + + sudo apt install -y zsync desktop-file-utils appstream + + mkdir -p tools + export PATH="$PATH:$(readlink -f tools)" + + # Setup appimagetool + wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" + chmod +x tools/appimagetool + + # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name) + if [ "$PLATFORM_NAME" = "linux-x64" ]; then + ARCH_NAME=x64 + export ARCH=x86_64 + elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then + ARCH_NAME=arm64 + export ARCH=aarch64 + else + echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME"" + exit 1 + fi + + export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync" + BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh + shell: bash + - name: Upload Ryujinx artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a2cefe71..51ed688bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -128,6 +128,43 @@ jobs: tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish popd shell: bash + + - name: Build AppImage (Linux) + if: matrix.platform.os == 'ubuntu-latest' + run: | + BUILD_VERSION="${{ steps.version_info.outputs.build_version }}" + PLATFORM_NAME="${{ matrix.platform.name }}" + + sudo apt install -y zsync desktop-file-utils appstream + + mkdir -p tools + export PATH="$PATH:$(readlink -f tools)" + + # Setup appimagetool + wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" + chmod +x tools/appimagetool + + # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name) + if [ "$PLATFORM_NAME" = "linux-x64" ]; then + ARCH_NAME=x64 + export ARCH=x86_64 + elif [ "$PLATFORM_NAME" = "linux-arm64" ]; then + ARCH_NAME=arm64 + export ARCH=aarch64 + else + echo "Unexpected PLATFORM_NAME "$PLATFORM_NAME"" + exit 1 + fi + + export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync" + BUILDDIR=publish_ava OUTDIR=publish_ava_appimage distribution/linux/appimage/build-appimage.sh + + # Add to release output + pushd publish_ava_appimage + mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage + mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync + popd + shell: bash - name: Pushing new release uses: ncipollo/release-action@v1 diff --git a/distribution/linux/appimage/AppRun b/distribution/linux/appimage/AppRun new file mode 100755 index 000000000..adbb70a0a --- /dev/null +++ b/distribution/linux/appimage/AppRun @@ -0,0 +1,3 @@ +#!/bin/sh +CURRENTDIR="$(readlink -f "$(dirname "$0")")" +exec "$CURRENTDIR"/usr/bin/Ryujinx.sh "$@" diff --git a/distribution/linux/appimage/build-appimage.sh b/distribution/linux/appimage/build-appimage.sh new file mode 100755 index 000000000..2f34f8ad3 --- /dev/null +++ b/distribution/linux/appimage/build-appimage.sh @@ -0,0 +1,30 @@ +#!/bin/sh +set -eu + +ROOTDIR="$(readlink -f "$(dirname "$0")")"/../../../ +cd "$ROOTDIR" + +BUILDDIR=${BUILDDIR:-publish} +OUTDIR=${OUTDIR:-publish_appimage} +UFLAG=${UFLAG:-"gh-releases-zsync|ryujinx-mirror|ryujinx|latest|*-x64.AppImage.zsync"} + +rm -rf AppDir +mkdir -p AppDir/usr/bin + +cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop +cp distribution/linux/appimage/AppRun AppDir/AppRun +cp distribution/misc/Logo.svg AppDir/Ryujinx.svg + +cp -r "$BUILDDIR"/* AppDir/usr/bin/ + +# Ensure necessary bins are set as executable +chmod +x AppDir/AppRun AppDir/usr/bin/Ryujinx* + +mkdir -p "$OUTDIR" + +appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 21 \ + -u "$UFLAG" \ + AppDir "$OUTDIR"/Ryujinx.AppImage + +# Move zsync file needed for delta updates +mv ./*.AppImage.zsync "$OUTDIR" From 57b255c83198a5f729ccdf23326392c7eac7c190 Mon Sep 17 00:00:00 2001 From: Piplup Date: Mon, 21 Oct 2024 16:13:55 +0100 Subject: [PATCH 2/9] oops --- distribution/linux/appimage/build-appimage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/linux/appimage/build-appimage.sh b/distribution/linux/appimage/build-appimage.sh index 2f34f8ad3..bdd1197a5 100755 --- a/distribution/linux/appimage/build-appimage.sh +++ b/distribution/linux/appimage/build-appimage.sh @@ -6,7 +6,7 @@ cd "$ROOTDIR" BUILDDIR=${BUILDDIR:-publish} OUTDIR=${OUTDIR:-publish_appimage} -UFLAG=${UFLAG:-"gh-releases-zsync|ryujinx-mirror|ryujinx|latest|*-x64.AppImage.zsync"} +UFLAG=${UFLAG:-"gh-releases-zsync|GreemDev|ryujinx|latest|*-x64.AppImage.zsync"} rm -rf AppDir mkdir -p AppDir/usr/bin From 68a81f3c46cbd1e3dd039163717a0426ff7ff9b9 Mon Sep 17 00:00:00 2001 From: Piplup Date: Mon, 21 Oct 2024 22:43:32 +0100 Subject: [PATCH 3/9] Addressed Feedback --- .github/workflows/build.yml | 1 + .github/workflows/release.yml | 1 + distribution/linux/appimage/build-appimage.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94a62c0ff..b1347f26b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,6 +86,7 @@ jobs: # Setup appimagetool wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" chmod +x tools/appimagetool + chmod +x distribution/linux/appimage/build-appimage.sh # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name) if [ "$PLATFORM_NAME" = "linux-x64" ]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51ed688bc..306bafd16 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,6 +143,7 @@ jobs: # Setup appimagetool wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" chmod +x tools/appimagetool + chmod +x distribution/linux/appimage/build-appimage.sh # Explicitly set $ARCH for appimagetool ($ARCH_NAME is for the file name) if [ "$PLATFORM_NAME" = "linux-x64" ]; then diff --git a/distribution/linux/appimage/build-appimage.sh b/distribution/linux/appimage/build-appimage.sh index bdd1197a5..b3932b3bd 100755 --- a/distribution/linux/appimage/build-appimage.sh +++ b/distribution/linux/appimage/build-appimage.sh @@ -15,7 +15,7 @@ cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop cp distribution/linux/appimage/AppRun AppDir/AppRun cp distribution/misc/Logo.svg AppDir/Ryujinx.svg -cp -r "$BUILDDIR"/* AppDir/usr/bin/ +cp -r "$BUILDDIR"/publish/* AppDir/usr/bin/ # Ensure necessary bins are set as executable chmod +x AppDir/AppRun AppDir/usr/bin/Ryujinx* From 7aca4abdd6c8d4c4ab78224122b075d96fa0d606 Mon Sep 17 00:00:00 2001 From: Piplup Date: Wed, 23 Oct 2024 16:51:53 +0100 Subject: [PATCH 4/9] i dislike workflows --- distribution/linux/appimage/build-appimage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/linux/appimage/build-appimage.sh b/distribution/linux/appimage/build-appimage.sh index b3932b3bd..bdd1197a5 100755 --- a/distribution/linux/appimage/build-appimage.sh +++ b/distribution/linux/appimage/build-appimage.sh @@ -15,7 +15,7 @@ cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop cp distribution/linux/appimage/AppRun AppDir/AppRun cp distribution/misc/Logo.svg AppDir/Ryujinx.svg -cp -r "$BUILDDIR"/publish/* AppDir/usr/bin/ +cp -r "$BUILDDIR"/* AppDir/usr/bin/ # Ensure necessary bins are set as executable chmod +x AppDir/AppRun AppDir/usr/bin/Ryujinx* From 24d3ea853a31fcb660a56584fb1a4a880a71469e Mon Sep 17 00:00:00 2001 From: Piplup Date: Wed, 23 Oct 2024 17:11:27 +0100 Subject: [PATCH 5/9] appimages woooo uploading appimages to release and PR's --- .github/workflows/build.yml | 7 +++++++ .github/workflows/release.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1347f26b..3ad38e405 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,6 +111,13 @@ jobs: path: publish if: github.event_name == 'pull_request' && matrix.platform.os != 'macos-13' + - name: Upload Ryujinx (AppImage) artifact + uses: actions/upload-artifact@v4 + if: github.event_name == 'pull_request' && matrix.platform.os == 'ubuntu-latest' + with: + name: ryujinx-${{ matrix.configuration }}-${{ env.RYUJINX_BASE_VERSION }}+${{ steps.git_short_hash.outputs.result }}-${{ matrix.platform.zip_os_name }}-AppImage + path: publish_appimage + - name: Upload Ryujinx.Headless.SDL2 artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 306bafd16..a2314d629 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,7 +171,7 @@ jobs: uses: ncipollo/release-action@v1 with: name: ${{ steps.version_info.outputs.build_version }} - artifacts: "release_output/*.tar.gz,release_output/*.zip" + artifacts: "release_output/*.tar.gz,release_output/*.zip/*AppImage*" tag: ${{ steps.version_info.outputs.build_version }} body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.version_info.outputs.prev_build_version }}...${{ steps.version_info.outputs.build_version }}" omitBodyDuringUpdate: true From a953e4d9cb57d08809c2be4fa2a3cba9455e978f Mon Sep 17 00:00:00 2001 From: Piplup Date: Wed, 23 Oct 2024 17:33:42 +0100 Subject: [PATCH 6/9] Updated Logo --- distribution/linux/appimage/build-appimage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/linux/appimage/build-appimage.sh b/distribution/linux/appimage/build-appimage.sh index bdd1197a5..4a22f3d80 100755 --- a/distribution/linux/appimage/build-appimage.sh +++ b/distribution/linux/appimage/build-appimage.sh @@ -13,7 +13,7 @@ mkdir -p AppDir/usr/bin cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop cp distribution/linux/appimage/AppRun AppDir/AppRun -cp distribution/misc/Logo.svg AppDir/Ryujinx.svg +cp src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png AppDir/Ryujinx.svg cp -r "$BUILDDIR"/* AppDir/usr/bin/ From 9fb679137f80e8668afc89fb592cb567666a1f89 Mon Sep 17 00:00:00 2001 From: Piplup Date: Sat, 26 Oct 2024 13:20:05 +0100 Subject: [PATCH 7/9] Addressed Feedback added AppImage build files to gitignore --- .github/workflows/release.yml | 2 ++ .gitignore | 2 ++ distribution/linux/appimage/build-appimage.sh | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2314d629..51d9b13dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -166,6 +166,8 @@ jobs: mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync popd shell: bash + env: + RELEASE=1 - name: Pushing new release uses: ncipollo/release-action@v1 diff --git a/.gitignore b/.gitignore index 37b419d07..f71237b1a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ x64/ build/ [Bb]in/ [Oo]bj/ +AppDir/ +publish_appimage/ # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets !packages/*/build/ diff --git a/distribution/linux/appimage/build-appimage.sh b/distribution/linux/appimage/build-appimage.sh index 4a22f3d80..5c32d78a8 100755 --- a/distribution/linux/appimage/build-appimage.sh +++ b/distribution/linux/appimage/build-appimage.sh @@ -15,6 +15,7 @@ cp distribution/linux/Ryujinx.desktop AppDir/Ryujinx.desktop cp distribution/linux/appimage/AppRun AppDir/AppRun cp src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png AppDir/Ryujinx.svg + cp -r "$BUILDDIR"/* AppDir/usr/bin/ # Ensure necessary bins are set as executable @@ -27,4 +28,6 @@ appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 2 AppDir "$OUTDIR"/Ryujinx.AppImage # Move zsync file needed for delta updates -mv ./*.AppImage.zsync "$OUTDIR" +if [ "$RELEASE" = "1" ]; then + mv ./*.AppImage.zsync "$OUTDIR" +fi From fa6da0e85cc608522aab6e2eeb4662de548ddeaf Mon Sep 17 00:00:00 2001 From: Piplup Date: Sat, 26 Oct 2024 13:24:03 +0100 Subject: [PATCH 8/9] silly piplup --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ad38e405..a32959bc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,6 +103,8 @@ jobs: export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync" BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh shell: bash + env: + RELEASE=0 - name: Upload Ryujinx artifact uses: actions/upload-artifact@v4 From 2c0aa1df9bdbf79c8224950509b6caa5f1c3f406 Mon Sep 17 00:00:00 2001 From: Piplup Date: Sat, 26 Oct 2024 13:29:54 +0100 Subject: [PATCH 9/9] lack of sleep this is why i shouldn't do things after not sleeping --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51d9b13dd..ef2a5256b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ env: RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "master" RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "GreemDev" RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "Ryujinx" + RELEASE=1 jobs: tag: @@ -166,8 +167,6 @@ jobs: mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync popd shell: bash - env: - RELEASE=1 - name: Pushing new release uses: ncipollo/release-action@v1