mirror of
https://github.com/knutwurst/patchdl.git
synced 2026-10-06 14:00:21 +02:00
149 lines
3.9 KiB
YAML
149 lines
3.9 KiB
YAML
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 }}
|