From 5dc5ee57b38db7d1c5513481e736788a04347c41 Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Sat, 27 Jun 2026 19:19:05 +0200 Subject: [PATCH] Add PS5 GitHub Actions build --- .github/release-files.txt | 6 ++ .github/workflows/ps5.yml | 148 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 .github/release-files.txt create mode 100644 .github/workflows/ps5.yml diff --git a/.github/release-files.txt b/.github/release-files.txt new file mode 100644 index 0000000..f343f1f --- /dev/null +++ b/.github/release-files.txt @@ -0,0 +1,6 @@ +# Files included in the release archive. +# One path per line, relative to the repository root. + +patchdl-ps5.elf +README.md +LICENSE diff --git a/.github/workflows/ps5.yml b/.github/workflows/ps5.yml new file mode 100644 index 0000000..4ebd7ca --- /dev/null +++ b/.github/workflows/ps5.yml @@ -0,0 +1,148 @@ +name: PS5 Build and Release + +on: + push: + paths-ignore: + - "**/*.md" + - "docs/**" + - "photos/**" + pull_request: + paths-ignore: + - "**/*.md" + - "docs/**" + - "photos/**" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: false + +permissions: + contents: read + +jobs: + build: + outputs: + archive_name: ${{ steps.package.outputs.archive_name }} + runs-on: ubuntu-latest + steps: + - name: Checkout PatchDL + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Checkout pacbrew-repo + uses: actions/checkout@v4 + with: + repository: ps5-payload-dev/pacbrew-repo + path: pacbrew-repo + + - name: Checkout SDK stubs + uses: actions/checkout@v4 + with: + repository: ps5-payload-dev/sdk + path: ps5-sdk + + - name: Setup build environment + run: | + sudo apt update + sudo apt install -y \ + autoconf \ + automake \ + build-essential \ + clang-18 \ + cmake \ + curl \ + git \ + libarchive-tools \ + libtool \ + lld-18 \ + makepkg \ + meson \ + ninja-build \ + pacman-package-manager \ + pkg-config \ + python3 \ + zip + + - name: Build and install pacbrew packages + shell: bash + run: | + set -euo pipefail + + build_and_install() { + local package_dir="$1" + pushd "pacbrew-repo/${package_dir}" + makepkg -c -f + sudo pacman --noconfirm -U ./ps5-payload-*.pkg.tar.gz + popd + } + + build_and_install sdk + build_and_install libcxx + build_and_install zlib + build_and_install zstd + build_and_install openssl + build_and_install libpsl + build_and_install curl + + - name: Build payload + env: + PS5_PAYLOAD_SDK: /opt/ps5-payload-sdk + PS5_SCE_STUBS_DIR: ${{ github.workspace }}/ps5-sdk/sce_stubs + run: | + scripts/build_ps5.sh clean all + + - name: Create release archive + id: package + shell: bash + run: | + set -euo pipefail + version_tag="$(git describe --abbrev=6 --dirty --always --tags 2>/dev/null || echo "${GITHUB_SHA::7}")" + archive_name="PatchDL_${version_tag}.zip" + manifest_file=".github/release-files.txt" + + mapfile -t release_files < <(grep -Ev '^[[:space:]]*(#|$)' "${manifest_file}") + + if [ "${#release_files[@]}" -eq 0 ]; then + echo "Release manifest is empty: ${manifest_file}" >&2 + exit 1 + fi + + for release_file in "${release_files[@]}"; do + if [ ! -f "${release_file}" ]; then + echo "Missing release file: ${release_file}" >&2 + exit 1 + fi + done + + zip -9 "${archive_name}" "${release_files[@]}" + + echo "archive_name=${archive_name}" >> "$GITHUB_OUTPUT" + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.package.outputs.archive_name }} + path: ${{ steps.package.outputs.archive_name }} + if-no-files-found: error + + release: + needs: build + permissions: + contents: write + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: ${{ needs.build.outputs.archive_name }} + path: dist + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + generate_release_notes: true + files: dist/${{ needs.build.outputs.archive_name }}