Skip to content

Xbox Cloud Gaming app for PS5 Homebrew

C

release: a published release gets the CI-built Linux tarball; the release machine signs it

Rafael Abud Ferreirae5a4727bd99e
diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml
new file mode 100644
index 0000000..7020be6
--- /dev/null
+++ b/.github/workflows/release-linux.yml
@@ -0,0 +1,116 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+# A published release gets the Linux app: built on ubuntu-24.04 (glibc 2.39,
+# so it runs on most current distributions; one built on a newer desktop
+# wouldn't), self-tested, packed and attached with its checksum. The
+# signature is added from the release machine afterwards with
+# tools/desktop/sign-linux-release.sh: the signing key never leaves it.
+# The same steps as ci.yml's linux-app job.
+name: Release (Linux)
+
+on:
+ release:
+ types: [published]
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: Release tag to build and attach (vX.Y.Z)
+ required: true
+
+permissions:
+ contents: write
+
+jobs:
+ linux-tarball:
+ runs-on: ubuntu-24.04
+ env:
+ SDL3_VERSION: 3.4.18
+ CC: clang
+ CXX: clang++
+ TAG: ${{ github.event.release.tag_name || inputs.tag }}
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ env.TAG }}
+ submodules: recursive
+
+ - name: The tag matches the version in CMakeLists.txt
+ run: |
+ v=$(sed -n 's/^project(xcloud_ps5 VERSION \([0-9.]*\).*/\1/p' CMakeLists.txt)
+ [ "v$v" = "$TAG" ] || { echo "::error::tag $TAG but CMakeLists.txt says $v"; exit 1; }
+
+ - name: Tools and SDL3's backend libraries
+ run: |
+ sudo apt-get update -q
+ sudo apt-get install -y -q cmake ninja-build clang llvm nasm pkg-config \
+ libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
+ libxkbcommon-dev libwayland-dev libdecor-0-dev libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev \
+ libdrm-dev libgbm-dev libasound2-dev libpulse-dev libpipewire-0.3-dev libjack-jackd2-dev \
+ libdbus-1-dev libibus-1.0-dev libudev-dev libusb-1.0-0-dev
+
+ - name: SDL3 cache
+ id: sdl3-cache
+ uses: actions/cache@v6
+ with:
+ path: ~/.cache/xcloud-ps5/sdl3-${{ env.SDL3_VERSION }}
+ key: linux-app-sdl3-${{ env.SDL3_VERSION }}-ubuntu-24.04-r1
+
+ - name: SDL3 ${{ env.SDL3_VERSION }}
+ if: steps.sdl3-cache.outputs.cache-hit != 'true'
+ run: |
+ prefix=~/.cache/xcloud-ps5/sdl3-$SDL3_VERSION
+ work=$(mktemp -d)
+ curl -sSLf -o "$work/sdl.tar.gz" "https://github.com/libsdl-org/SDL/releases/download/release-$SDL3_VERSION/SDL3-$SDL3_VERSION.tar.gz"
+ tar xzf "$work/sdl.tar.gz" -C "$work"
+ cmake -S "$work/SDL3-$SDL3_VERSION" -B "$work/build" -G Ninja -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX="$prefix" -DCMAKE_INSTALL_LIBDIR=lib \
+ -DSDL_SHARED=ON -DSDL_STATIC=OFF -DSDL_TESTS=OFF -DSDL_EXAMPLES=OFF
+ cmake --build "$work/build"
+ cmake --install "$work/build"
+ mkdir -p "$prefix/share/licenses/SDL3"
+ cp "$work/SDL3-$SDL3_VERSION/LICENSE.txt" "$prefix/share/licenses/SDL3/LICENSE.txt"
+
+ - name: FFmpeg cache
+ uses: actions/cache@v6
+ with:
+ path: ~/.cache/xcloud-ps5/ffmpeg-host
+ key: linux-app-ffmpeg-host-${{ hashFiles('.git/modules/deps/ffmpeg/HEAD', 'tools/build-ffmpeg.sh') }}
+
+ - name: Configure
+ run: |
+ cmake -S . -B build-app -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DXCLOUD_DESKTOP_APP=ON \
+ -DCMAKE_PREFIX_PATH="$HOME/.cache/xcloud-ps5/sdl3-$SDL3_VERSION"
+
+ - name: Build
+ run: ninja -C build-app
+
+ - name: Unit tests
+ run: ctest --test-dir build-app --output-on-failure
+
+ - name: Self-test (window, screens, input, sound; no account)
+ env:
+ SDL_VIDEO_DRIVER: offscreen
+ SDL_AUDIO_DRIVER: dummy
+ XCLOUD_DATA_DIR: ${{ runner.temp }}/psbox-data
+ run: build-app/psbox --selftest "$RUNNER_TEMP/psbox-selftest"
+
+ - name: Package
+ run: XC_VERSION="$TAG" bash tools/desktop/package-linux.sh build-app build-app/pkg
+
+ - name: Attach to the release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ cd build-app/pkg
+ f="PSBox-$TAG-linux-x86_64.tar.gz"
+ [ -s "$f" ] || { echo "::error::$f was not made"; exit 1; }
+ sha256sum "$f" > "$f.sha256"
+ gh release upload "$TAG" "$f" "$f.sha256" --clobber --repo "$GITHUB_REPOSITORY"
+
+ # Crash offsets in a desktop report are decoded with this file
+ # (tools/symbolize.sh); kept for 90 days.
+ - uses: actions/upload-artifact@v7
+ with:
+ name: psbox-symbols-${{ env.TAG }}
+ path: symbols/${{ env.TAG }}/psbox.debug
+ retention-days: 90
+ if-no-files-found: warn
diff --git a/AGENTS.md b/AGENTS.md
index eac6324..c04ec3b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -91,7 +91,8 @@ Para evitar degradação de desempenho, latência alta e manter a interação á
1. `PPSA99810.zip` (pacote limpo sem contas/tokens, empacotado sem `XC_INCLUDE_ACCOUNT`).
2. `PPSA99810.zip.sig` (assinatura ECDSA gerada com `~/.config/psbox-release/signing-key.pem`).
3. `PPSA99810.zip.sha256` (checksum para integridade).
-- **Assets Opcionais do Linux (app desktop `psbox`)**, gerados com `tools/release.sh <X.Y.Z> --linux`:
+- **Assets do Linux (app desktop `psbox`) — caminho recomendado, automático:** ao publicar a release no GitHub, o workflow `.github/workflows/release-linux.yml` compila no ubuntu-24.04 e anexa `PSBox-vX.Y.Z-linux-x86_64.tar.gz` + `.sha256` (a tag precisa bater com a versão do `CMakeLists.txt`). Depois, na máquina de release, rodar `tools/desktop/sign-linux-release.sh vX.Y.Z`: baixa o tarball, confere o checksum, assina com a chave local (que nunca vai para o GitHub) e envia o `.sig`. Pode ser disparado à mão em Actions → "Release (Linux)" → Run workflow com a tag.
+- **Assets Opcionais do Linux gerados localmente** (alternativa; herdam a glibc desta máquina), com `tools/release.sh <X.Y.Z> --linux`:
1. `PSBox-vX.Y.Z-linux-x86_64.tar.gz` (pasta `PSBox/` com `psbox` sem debug info, `lib/libSDL3.so.0`, `assets/`, `licenses/`; nunca dados de conta).
2. `PSBox-vX.Y.Z-linux-x86_64.tar.gz.sig` (assinado com a **mesma** chave e o mesmo método do `PPSA99810.zip`).
3. `PSBox-vX.Y.Z-linux-x86_64.tar.gz.sha256`.
diff --git a/docs/multiplatform.md b/docs/multiplatform.md
index fe00ada..1f0e92c 100644
--- a/docs/multiplatform.md
+++ b/docs/multiplatform.md
@@ -281,3 +281,14 @@ keeps no release to install and Settings > Updates opens the release page.
`tools/release.sh` writes `symbols/vX.Y.Z`, the release's, which decode
users' crash reports (`tools/symbolize.sh`). A change to the PS5's UI is
still checked on the console with its screenshots (`AGENTS.md`).
+
+### Linux release assets (automatic)
+
+Publishing a GitHub release runs `.github/workflows/release-linux.yml`: the
+same build as CI's `linux-app` job on ubuntu-24.04 (glibc 2.39), the
+self-test, then `PSBox-vX.Y.Z-linux-x86_64.tar.gz` and its `.sha256`
+attached to the release; `psbox.debug` is kept as a 90-day artifact. The
+signature comes from the release machine, so the key never goes to GitHub:
+`tools/desktop/sign-linux-release.sh vX.Y.Z` downloads the tarball, checks
+the checksum, signs it like the PS5 zip and uploads the `.sig`. The workflow
+can also be run by hand (Actions → "Release (Linux)", with the tag).
diff --git a/tools/desktop/sign-linux-release.sh b/tools/desktop/sign-linux-release.sh
new file mode 100755
index 0000000..ab94ad9
--- /dev/null
+++ b/tools/desktop/sign-linux-release.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Copyright (C) 2026 RafaelNGP
+# Signs the Linux tarball that .github/workflows/release-linux.yml attached
+# to a published release, on the release machine: the signing key never goes
+# to GitHub. Downloads the tarball and its checksum, checks the checksum,
+# signs it as tools/release.sh signs the PS5 zip, checks the signature with
+# the key the app trusts, and uploads the .sig.
+#
+# tools/desktop/sign-linux-release.sh vX.Y.Z
+#
+# PSBOX_SIGNING_KEY: the private key (default ~/.config/psbox-release/signing-key.pem).
+set -euo pipefail
+
+tag=${1:?usage: tools/desktop/sign-linux-release.sh vX.Y.Z}
+[[ $tag == v* ]] || tag="v$tag"
+root=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
+key=${PSBOX_SIGNING_KEY:-$HOME/.config/psbox-release/signing-key.pem}
+fail() { echo "sign-linux-release: $*" >&2; exit 1; }
+
+[[ -r $key ]] || fail "no signing key at $key"
+pub=$(openssl pkey -in "$key" -pubout 2>/dev/null) || fail "$key is not a private key"
+while read -r line; do
+ [[ $line == -----* ]] || grep -qF "\"$line\n\"" "$root/src/app/updater.cpp" ||
+ fail "$key is not the key src/app/updater.cpp trusts"
+done <<<"$pub"
+
+name=PSBox-$tag-linux-x86_64.tar.gz
+work=$(mktemp -d)
+trap 'rm -rf "$work"' EXIT
+gh release download "$tag" -p "$name" -p "$name.sha256" -D "$work" ||
+ fail "$name is not on release $tag yet (the 'Release (Linux)' workflow attaches it)"
+(cd "$work" && sha256sum -c "$name.sha256" >/dev/null) || fail "$name doesn't match its checksum"
+
+openssl dgst -sha256 -sign "$key" -out "$work/$name.sig" "$work/$name"
+openssl dgst -sha256 -verify <(echo "$pub") -signature "$work/$name.sig" "$work/$name" >/dev/null ||
+ fail "the signature doesn't verify"
+gh release upload "$tag" "$work/$name.sig" --clobber
+echo "signed and uploaded $name.sig to $tag"
+gh release view "$tag" --json assets -q '.assets[].name' | grep -F "$name"