Files
unicxrn--prospack/.github/workflows/release.yml
T
2026-10-10 22:35:31 +02:00

121 lines
4.6 KiB
YAML

name: Release
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
# One at a time, so the two jobs don't race to write latest.json (the updater feed).
max-parallel: 1
matrix:
os: [ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Linux build dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev libssl-dev patchelf
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
src-tauri
installer/src-tauri
- name: Install
run: npm ci
- name: Freeze the engine
run: |
python -m pip install -r engine/requirements-build.txt
python engine/build.py
- name: Tests (unit + end-to-end with the frozen engine)
run: |
S="$RUNNER_TEMP/e2e"
python -m venv "$S/mkvenv"
if [ "$RUNNER_OS" = "Windows" ]; then PY="$S/mkvenv/Scripts/python.exe"; else PY="$S/mkvenv/bin/python"; fi
"$PY" -m pip install -r engine/requirements.txt pyftpdlib
cp tests/fake_ps5.py "$S/"
python engine/make_fake_dump.py "$S/fakedump/PPSA00001-app"
export PACKER_E2E_SCRATCH="$S"
export PROSPACK_ENGINE="$(cd src-tauri/binaries && pwd)/$(ls src-tauri/binaries | head -1)"
cargo test --manifest-path src-tauri/Cargo.toml -- --include-ignored --skip discover_lan
- name: Build and draft the release
uses: tauri-apps/tauri-action@v0
env:
# Signs the update files. The public half is in src-tauri/tauri.conf.json.
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
with:
includeUpdaterJson: true
updaterJsonPreferNsis: true
tagName: ${{ github.ref_name }}
releaseName: Prospack ${{ github.ref_name }}
releaseBody: |
**Windows:** download `Prospack-Setup-*.exe`. Unsigned, so SmartScreen may warn: More info → Run anyway.
**Linux:** `.AppImage` (any distro) or `.deb`.
SHA-256 checksums are in the `SHA256SUMS-*.txt` files.
releaseDraft: true
prerelease: false
- name: Prospack Setup (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: pwsh scripts/build-setup.ps1
- name: Smoke-test Prospack Setup (unattended install + uninstall)
if: runner.os == 'Windows'
shell: pwsh
run: |
$setup = Get-ChildItem dist/Prospack-Setup-*.exe | Select-Object -First 1
$dir = Join-Path $env:RUNNER_TEMP "pp-install"
$p = Start-Process $setup.FullName -ArgumentList "--unattended", $dir, "--no-desktop" -Wait -PassThru
if ($p.ExitCode -ne 0) { throw "setup exited with $($p.ExitCode)" }
if (-not (Test-Path (Join-Path $dir "prospack.exe"))) { throw "prospack.exe missing" }
if (-not (Test-Path (Join-Path $dir "prospack-engine.exe"))) { throw "engine missing" }
$key = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Prospack"
if (-not (Test-Path $key)) { throw "uninstall key missing" }
$u = Start-Process (Join-Path $dir "uninstall.exe") -ArgumentList "/S" -Wait -PassThru
Start-Sleep -Seconds 3
if (Test-Path (Join-Path $dir "prospack.exe")) { throw "uninstall left prospack.exe behind" }
- name: Upload Prospack Setup and checksums
run: |
TAG="${{ github.ref_name }}"
if [ "$RUNNER_OS" = "Windows" ]; then
FILES=$(ls dist/Prospack-Setup-*.exe src-tauri/target/release/bundle/nsis/*.exe src-tauri/target/release/bundle/msi/*.msi)
SUMS=SHA256SUMS-windows.txt
else
FILES=$(ls src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/deb/*.deb)
SUMS=SHA256SUMS-linux.txt
fi
sha256sum $FILES | sed 's# .*/# #' > "$SUMS"
cat "$SUMS"
if [ "$RUNNER_OS" = "Windows" ]; then gh release upload "$TAG" dist/Prospack-Setup-*.exe --clobber; fi
gh release upload "$TAG" "$SUMS" --clobber