diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 501ab1e..9f4fdc7 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -5,73 +5,74 @@ concurrency: on: schedule: - - cron: "0 16 1/14 * *" - workflow_dispatch: + - cron: "0 7 1/30 * *" + workflow_dispatch: {} jobs: build: - runs-on: ubuntu-latest + name: "${{ matrix.name }} (${{ matrix.arch }})" + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + include: + - runs-on: ubuntu-latest + name: Build AppImage + arch: x86_64 +# - runs-on: ubuntu-24.04-arm +# name: Build AppImage +# arch: aarch64 container: ghcr.io/pkgforge-dev/archlinux:latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + + - name: Get dependencies + run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh - - name: build - if: always() - run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh + - name: Make AppImage + run: chmod +x ./*-appimage.sh && ./*-appimage.sh - - name: Make AppImage - run: | - chmod +x ./*-appimage.sh && ./*-appimage.sh - mkdir dist - ls -la - mv *.AppImage* dist/ - mv *.AppBundle* dist/ + - name: Upload artifact + uses: actions/upload-artifact@v4.6.2 + with: + name: AppImage-${{ matrix.arch }} + path: dist - - name: Check version file - run: | - cat ~/version - echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}" - - - name: Upload artifact - uses: actions/upload-artifact@v4.6.2 - with: - name: AppImage - path: 'dist' - - - name: Upload version file - uses: actions/upload-artifact@v4.6.2 - with: - name: version - path: ~/version - release: - needs: [build] - permissions: write-all - runs-on: ubuntu-latest + if: ${{ github.ref_name == 'main' }} + needs: [build] + permissions: write-all + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4.3.0 + with: + pattern: AppImage-* + merge-multiple: true + + - name: Read version and Get date + run: | + cat ./version + echo "VERSION=$(cat ./version)" >> "${GITHUB_ENV}" + echo "DATE=$(date +'%Y-%m-%d_%s')" >> "${GITHUB_ENV}" - steps: - - uses: actions/download-artifact@v4.3.0 - with: - name: AppImage - - uses: actions/download-artifact@v4.3.0 - with: - name: version + - name: Release Artifacts + uses: softprops/action-gh-release@v2.2.2 + with: + name: "UnleashedRecomp: ${{ env.VERSION }}" + tag_name: "${{ env.VERSION }}@${{ env.DATE }}" + prerelease: false + draft: false + generate_release_notes: false + make_latest: true + files: | + *.AppImage* + *.AppBundle* - - name: Read version and Get date - run: | - echo "VERSION=$(cat version)" >> "${GITHUB_ENV}" - echo "DATE=$(date +'%Y-%m-%d_%s')" >> "$GITHUB_ENV" - - - name: Release Artifacts - uses: softprops/action-gh-release@v2.3.2 - with: - name: "UnleashedRecomp: ${{ env.VERSION }}" - tag_name: "${{ env.VERSION }}@${{ env.DATE }}" - prerelease: false - draft: false - generate_release_notes: false - fail_on_unmatched_files: false - make_latest: true - files: | - *.AppImage* - *.AppBundle* + - uses: actions/checkout@v4 + - name: Update LATEST_VERSION + run: | + echo "${{ env.VERSION }}" > ./LATEST_VERSION + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add ./LATEST_VERSION + git commit --allow-empty -m 'bump `LATEST_VERSION` [skip ci]' + git push diff --git a/README.md b/README.md index 854e29b..955217f 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ # ⚠️ WARNING ⚠️ -This repo uses the same binary used for the [AUR package](https://aur.archlinux.org/packages/unleashedrecomp-bin), **unfortunately because compilation needs binaries from the xbox360 which cannot be distributed, there is no transparency on how the binary was built at all** +This repo uses the [AUR package](https://aur.archlinux.org/packages/unleashedrecomp-bin) to get the unleashedrecomp binary, **unfortunately because compilation needs binaries from the xbox360 which cannot be distributed, there is no transparency on how the binary was built at all** -If you wish to still use this, it is strongly suggested that you sandbox this with [aisap](https://github.com/mgord9518/aisap) +If you wish to still use this, it is strongly suggested that you sandbox this with [sas](https://github.com/Samueru-sama/simple-appimage-sandbox) * [Latest Stable Release](https://github.com/pkgforge-dev/UnleashedRecomp-AppImage/releases/latest) @@ -21,7 +21,7 @@ AppImage made using [sharun](https://github.com/VHSgunzo/sharun), which makes it It is possible that this appimage may fail to work with appimagelauncher, I recommend these alternatives instead: -* [AM](https://github.com/ivan-hc/AM) `am -ias unleashedrecomp` or `appman -ias unleashedrecomp` **it gets sandboxed with aisap** +* [AM](https://github.com/ivan-hc/AM) `am -ias unleashedrecomp` or `appman -ias unleashedrecomp` **it gets sandboxed with sas** * [dbin](https://github.com/xplshn/dbin) `dbin install unleashedrecomp.appimage` diff --git a/get-dependencies.sh b/get-dependencies.sh index 420b32f..d05004a 100644 --- a/get-dependencies.sh +++ b/get-dependencies.sh @@ -1,62 +1,38 @@ #!/bin/sh -set -ex - -sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf - -if [ "$(uname -m)" = 'x86_64' ]; then - PKG_TYPE='x86_64.pkg.tar.zst' -else - PKG_TYPE='aarch64.pkg.tar.xz' -fi - -LLVM_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/llvm-libs-nano-$PKG_TYPE" -LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-$PKG_TYPE" -OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/opus-nano-$PKG_TYPE" -FFMPEG_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/ffmpeg-mini-$PKG_TYPE" +set -eux +ARCH="$(uname -m)" +EXTRA_PACKAGES="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/get-debloated-pkgs.sh" echo "Installing build dependencies..." echo "---------------------------------------------------------------" pacman -Syu --noconfirm \ - base-devel \ - curl \ - desktop-file-utils \ - git \ - gtk3 \ - libxss \ - patchelf \ - pipewire-audio \ - pulseaudio \ - pulseaudio-alsa \ - strace \ - unzip \ - vulkan-headers \ + base-devel \ + curl \ + git \ + libxss \ + pipewire-audio \ + pulseaudio \ + pulseaudio-alsa \ + unzip \ + vulkan-headers \ vulkan-mesa-layers \ - vulkan-nouveau \ - vulkan-radeon \ - wayland \ - wget \ - xorg-server-xvfb \ + wayland \ + wget \ + xorg-server-xvfb \ zsync -if [ "$(uname -m)" = 'x86_64' ]; then - pacman -Syu --noconfirm vulkan-intel -else - pacman -Syu --noconfirm \ - vulkan-freedreno vulkan-panfrost vulkan-broadcom -fi - -echo "Installing debloated pckages..." +echo "Installing debloated packages..." echo "---------------------------------------------------------------" -wget --retry-connrefused --tries=30 "$LLVM_URL" -O ./llvm.pkg.tar.zst -wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2.pkg.tar.zst -wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus.pkg.tar.zst -wget --retry-connrefused --tries=30 "$FFMPEG_URL" -O ./ffmpeg.pkg.tar.zst - -pacman -U --noconfirm ./*.pkg.tar.zst -rm -f ./*.pkg.tar.zst +wget --retry-connrefused --tries=30 "$EXTRA_PACKAGES" -O ./get-debloated-pkgs.sh +chmod +x ./get-debloated-pkgs.sh +./get-debloated-pkgs.sh --add-mesa libxml2-mini gtk3-mini ffmpeg-mini opus-mini +sed -i 's|EUID == 0|EUID == 69|g' /usr/bin/makepkg +git clone https://aur.archlinux.org/unleashedrecomp-bin.git ./unleashedrecomp +cd ./unleashedrecomp +makepkg -fs --noconfirm +pacman --noconfirm -U ./*.pkg.tar.* -echo "All done!" -echo "---------------------------------------------------------------" +pacman -Q unleashedrecomp-bin | awk '{print $2; exit}' > ~/version diff --git a/sonic-appimage.sh b/sonic-appimage.sh index 5a7744b..cdaf499 100644 --- a/sonic-appimage.sh +++ b/sonic-appimage.sh @@ -2,70 +2,29 @@ set -eux -PACKAGE=UnleashedRecomp -ICON="https://raw.githubusercontent.com/hedge-dev/UnleashedRecompResources/e5a4adccb30734321ac17347090abeb6690dab70/images/game_icon.png" - -export ARCH="$(uname -m)" -export APPIMAGE_EXTRACT_AND_RUN=1 - -UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync" -LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin" -APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage" -BINARY=$(wget "https://api.github.com/repos/Jujstme/UnleashedRecomp/releases" -O - \ - | sed 's/[()",{} ]/\n/g' | grep -oi "https.*unleashed.*.zip$" | head -1) -VERSION=$(echo "$BINARY" | awk -F'/' '{print $(NF-1)}') -echo "$VERSION" > ~/version - -# Prepare AppDir -mkdir -p ./AppDir/shared/bin -cd ./AppDir - -wget "$ICON" -O ./unleashedrecomp.png -ln -s unleashedrecomp.png ./.DirIcon - -echo '[Desktop Entry] -Name=Unleashed Recompiled -Exec=UnleashedRecomp --sdl-video-driver wayland -Type=Application -Icon=unleashedrecomp -Categories=Game; -Comment=Static recompilation of Sonic Unleashed -MimeType=x-scheme-handler/unleashedrecomp -StartupWMClass=UnleashedRecomp' > ./unleashedrecomp.desktop - -wget "$BINARY" -O ./bin.zip -unzip ./bin.zip -rm -f ./bin.zip -mv -v ./UnleashedRecomp ./shared/bin +ARCH="$(uname -m)" +VERSION="$(cat ~/version)" +URUNTIME="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/uruntime2appimage.sh" +SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/refs/heads/main/useful-tools/quick-sharun.sh" + +export DESKTOP=/usr/share/applications/io.github.hedge_dev.unleashedrecomp.desktop +export ICON=/usr/share/icons/hicolor/128x128/apps/io.github.hedge_dev.unleashedrecomp.png +export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync" +export OUTNAME=UnleashedRecomp-"$VERSION"-anylinux-"$ARCH".AppImage +export DEPLOY_PIPEWIRE=1 +export DEPLOY_VULKAN=1 # ADD LIBRARIES -wget "$LIB4BN" -O ./lib4bin -chmod +x ./lib4bin -xvfb-run -a -- ./lib4bin -p -v -e -s -k \ - ./shared/bin/UnleashedRecomp \ - /usr/lib/gconv/* \ - /usr/lib/libvulkan* \ - /usr/lib/libwayland* \ - /usr/lib/gtk-3*/*/* \ - /usr/lib/dri/* \ - /usr/lib/libXss.so* \ - /usr/lib/pulseaudio/* \ - /usr/lib/pipewire-0.3/* \ - /usr/lib/spa-0.2/*/* - -# Prepare sharun -echo "Preparing sharun..." -ln ./sharun ./AppRun -./sharun -g +wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun +chmod +x ./quick-sharun +./quick-sharun /usr/bin/UnleashedRecomp /usr/lib/pulseaudio/* # MAKE APPIMAGE WITH URUNTIME -cd .. -wget "$APPIMAGETOOL" -O ./appimagetool -chmod +x ./appimagetool - -echo "Generating AppImage..." -./appimagetool -n -u "$UPINFO" "$PWD"/AppDir "$PWD"/"$PACKAGE"-"$VERSION"-anylinux-"$ARCH".AppImage +wget --retry-connrefused --tries=30 "$URUNTIME" -O ./uruntime2appimage +chmod +x ./uruntime2appimage +./uruntime2appimage +# make appbundle UPINFO="$(echo "$UPINFO" | sed 's#.AppImage.zsync#*.AppBundle.zsync#g')" wget -O ./pelf "https://github.com/xplshn/pelf/releases/latest/download/pelf_$(uname -m)" chmod +x ./pelf @@ -73,10 +32,13 @@ echo "Generating [dwfs]AppBundle..." ./pelf --add-appdir ./AppDir \ --appimage-compat \ --add-updinfo "$UPINFO" \ - --appbundle-id="$PACKAGE#github.com/$GITHUB_REPOSITORY:$VERSION@$(date +%d_%m_%Y)" \ + --appbundle-id="UnleashedRecomp#github.com/$GITHUB_REPOSITORY:$VERSION@$(date +%d_%m_%Y)" \ --compression "-C zstd:level=22 -S26 -B8" \ - --output-to "$PACKAGE-$VERSION-anylinux-$ARCH.dwfs.AppBundle" - + --output-to ./UnleashedRecomp-"$VERSION"-anylinux-"$ARCH".dwfs.AppBundle zsyncmake ./*.AppBundle -u ./*.AppBundle +mkdir -p ./dist +mv -v ./*.AppImage* ./dist +mv -v ~/version ./dist + echo "All Done!"