From bd01deefba7697fa096362074d19c7cb5d024b24 Mon Sep 17 00:00:00 2001 From: bryanthaboi Date: Wed, 7 Oct 2026 16:33:36 -0400 Subject: [PATCH] Ship PS4 .pkg in releases --- .github/workflows/ci.yml | 6 ++-- .github/workflows/release.yml | 65 +++++++++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dd3508f..a2da2b04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,10 +196,10 @@ jobs: fetch-depth: 0 - id: paths env: - BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} - HEAD_SHA: ${{ github.sha }} + BASE_SHA: ${{ (github.event.action == 'synchronize' && github.event.before) || github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} run: | - if [ -z "$BASE_SHA" ] || [ "$BASE_SHA" = "0000000000000000000000000000000000000000" ]; then + if [ -z "$BASE_SHA" ] || [ "$BASE_SHA" = "0000000000000000000000000000000000000000" ] || ! git cat-file -e "$BASE_SHA^{commit}" 2>/dev/null; then echo "changed=true" >> "$GITHUB_OUTPUT" exit 0 fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0f86b43..723abb3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release # Builds the macOS, Windows, and Linux desktop apps, an Android APK, an iOS -# IPA, a Nintendo Switch SD-ready zip (experimental), Xbox UWP, the Anbernic +# IPA, a Nintendo Switch SD-ready zip (experimental), a PS4 homebrew .pkg, Xbox UWP, the Anbernic # RG34XXSP (Stock OS 64-bit MOD / PortMaster) and Linux ARM SBC PortMaster # handheld ports on the self-hosted Mac runner, and publishes them as a # GitHub Release. @@ -723,6 +723,56 @@ jobs: if-no-files-found: error retention-days: 7 + ps4: + name: build PS4 + needs: version + runs-on: ubuntu-latest + env: + OO_TAG: v0.5.4 + OO_SHA256: 3c7cd5bb593ca74fa1c13fd59f3938dc0fc07985167f7275063019e63abe4526 + OO_PS4_TOOLCHAIN: ${{ github.workspace }}/.bazinga/openorbis/OpenOrbis/PS4Toolchain + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Restore pinned love-ps4 runtime + uses: actions/cache@v6 + with: + path: .bazinga/love-ps4 + key: love-ps4-${{ hashFiles('scripts/ps4/love-ps4-runtime.sha256') }} + + - name: Restore OpenOrbis packaging tools + id: oo-cache + uses: actions/cache@v6 + with: + path: .bazinga/openorbis + key: openorbis-${{ env.OO_TAG }}-${{ env.OO_SHA256 }} + + - name: Fetch OpenOrbis packaging tools + if: steps.oo-cache.outputs.cache-hit != 'true' + run: | + set -euo pipefail + mkdir -p .bazinga/openorbis + curl -fL --retry 3 -o "$RUNNER_TEMP/oo.tar.gz" \ + "https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/releases/download/$OO_TAG/toolchain-llvm-18.tar.gz" + echo "$OO_SHA256 $RUNNER_TEMP/oo.tar.gz" | sha256sum -c - + tar -xzf "$RUNNER_TEMP/oo.tar.gz" -C .bazinga/openorbis OpenOrbis/PS4Toolchain/bin/linux + + - name: Build PS4 + run: | + set -euo pipefail + scripts/build_ps4.sh --fetch --fused \ + --version "${{ needs.version.outputs.version }}" + + - name: Upload gen1recomp-ps4-release + uses: actions/upload-artifact@v7 + with: + name: gen1recomp-ps4-release + path: | + dist/ps4/gen1recomp-${{ needs.version.outputs.version }}-ps4.pkg + if-no-files-found: error + retention-days: 7 + rg34xxsp: name: build Anbernic RG34XXSP port needs: [version, shaderfx-bridge] @@ -991,7 +1041,7 @@ jobs: retention-days: 7 release: - needs: [version, notes, love-payload, xbox-uwp, linux-arm64, linux-flatpak, desktop, windows-sign, android, ios, switch, rg34xxsp, linux-arm-sbc] + needs: [version, notes, love-payload, xbox-uwp, linux-arm64, linux-flatpak, desktop, windows-sign, android, ios, switch, ps4, rg34xxsp, linux-arm-sbc] if: github.repository == 'bryanthaboi/gen1recomp' runs-on: ubuntu-latest steps: @@ -1043,6 +1093,12 @@ jobs: name: gen1recomp-switch-release path: dist/switch + - name: Download gen1recomp-ps4-release + uses: actions/download-artifact@v8 + with: + name: gen1recomp-ps4-release + path: dist/ps4 + - name: Download gen1recomp-rg34xxsp-release uses: actions/download-artifact@v8 with: @@ -1116,6 +1172,10 @@ jobs: # Local fused .nro stays under dist/switch/ for PR CI / debug; release # publishes the SD-ready zip only. + ps4pkg="dist/ps4/gen1recomp-${v}-ps4.pkg" + [ -f "$ps4pkg" ] || { echo "::error::$ps4pkg not found (expected from scripts/build_ps4.sh --fused)"; exit 1; } + cp "$ps4pkg" "$outdir/gen1recomp-${v}-ps4.pkg" + uwp="dist/xbox-uwp/gen1recomp-${v}-xbox-uwp.zip" [ -f "$uwp" ] || { echo "::error::$uwp not found (expected from the Xbox UWP job)"; exit 1; } cp "$uwp" "$outdir/gen1recomp-${v}-xbox-uwp.zip" @@ -1166,6 +1226,7 @@ jobs: "dist/release/gen1recomp-${v}-android.apk" "dist/release/gen1recomp++-${v}-ios.ipa" "dist/release/gen1recomp-${v}-switch.zip" + "dist/release/gen1recomp-${v}-ps4.pkg" "dist/release/gen1recomp-${v}-xbox-uwp.zip" "dist/release/gen1recomp-${v}-rg34xxsp-stockos64-mod.zip" "dist/release/gen1recomp-${v}-sbc-portmaster.zip"