Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
build(release): installer downloads the app and uploads only when it changes; reuse passed checks
raymondchins543606eb7e84
diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 371551f..f9d52eb 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -1,8 +1,14 @@# Releasing Bridgeplay-Every release is a GitHub release of `raymondchins/Bridgeplay` carrying `Bridgeplay.zip`,-`appcast.xml` and `Bridgeplay-Installer.zip` (bridgeplay.dev's Download links to-`releases/latest/download/Bridgeplay-Installer.zip`). Installed apps read+Every release is a GitHub release of `raymondchins/Bridgeplay` carrying `Bridgeplay.zip` and+`appcast.xml`. The one-click `Bridgeplay-Installer.zip` lives on its own prerelease, tag+`installer` (bridgeplay.dev/download redirects to+`releases/download/installer/Bridgeplay-Installer.zip`). It carries no app: `Install.command`+downloads the Latest release's `Bridgeplay.zip` when it runs, so `release-local.sh` uploads+the installer again only when its fingerprint (every file it ships) changes, which is when+the engines, GPTK, the configs or the installer itself change. A release whose sources+already passed `make ci-checks` (only the version bump differs) skips them;+`BRIDGEPLAY_FORCE_CHECKS=1` runs them anyway. Installed apps read`https://github.com/raymondchins/Bridgeplay/releases/latest/download/appcast.xml`(`SUFeedURL`), so whatever release is marked **Latest** is the update feed.diff --git a/installer/Install.command b/installer/Install.commandindex ff1c5f4..1c32f92 100755--- a/installer/Install.command+++ b/installer/Install.command@@ -1,6 +1,7 @@#!/bin/bash# Bridgeplay one-click installer.-# Copies Bridgeplay, Apple's Game Porting Toolkit (D3DMetal), the WineCX engine (no download)+# Downloads the latest Bridgeplay from GitHub, copies Apple's Game Porting Toolkit+# (D3DMetal), the WineCX engine (no download)# and the default configs, installs Steam from Valve's CDN when it is missing, then opens# Bridgeplay, whose Setup Assistant does the rest: Rosetta, sign-in, the App Management# permission and the Steam setup. Assembled into a zip by scripts/package-installer.sh.@@ -33,10 +34,14 @@ steam_url="https://cdn.cloudflare.steamstatic.com/client/installer/steam.dmg"valve_team="MXGJJ98X76"steam_tmp=""steam_mnt=""+# The installer carries no app, so it never goes stale: it installs the Latest release.+app_url="https://github.com/raymondchins/Bridgeplay/releases/latest/download/Bridgeplay.zip"+app_tmp=""# shellcheck disable=SC2329 # runs from the EXIT trapcleanup() {if [ -n "$steam_mnt" ]; then hdiutil detach -quiet "$steam_mnt" >/dev/null 2>&1; fiif [ -n "$steam_tmp" ]; then rm -rf "$steam_tmp"; fi+ if [ -n "$app_tmp" ]; then rm -rf "$app_tmp"; fireturn 0}trap cleanup EXIT@@ -47,7 +52,21 @@ xattr -dr com.apple.quarantine "$here" 2>/dev/null || truemajor="$(sw_vers -productVersion | cut -d. -f1)"[ "$major" -ge 26 ] || die "Butuh macOS 26 atau lebih baru (sekarang $(sw_vers -productVersion)). Update macOS dulu."[ -w /Applications ] || die "Akun ini tidak bisa menulis ke folder Applications. Login dengan akun admin, lalu jalankan Install.command lagi."-[ -d "$here/Bridgeplay.app" ] || die "Bridgeplay.app tidak ada di folder installer. Ekstrak ulang zip-nya, lalu coba lagi."+# An installer from before the app was left out still carries Bridgeplay.app; use it.+app_src="$here/Bridgeplay.app"+if [ ! -d "$app_src" ]; then+ say "Mengunduh Bridgeplay versi terbaru..."+ app_tmp="$(mktemp -d)"+ curl -fL --retry 3 --connect-timeout 20 --progress-bar -o "$app_tmp/Bridgeplay.zip" "$app_url" \+ || die "Bridgeplay gagal diunduh. Cek koneksi internet, lalu jalankan Install.command lagi."+ ditto -x -k "$app_tmp/Bridgeplay.zip" "$app_tmp" || die "File Bridgeplay yang diunduh rusak. Jalankan Install.command lagi."+ app_src="$app_tmp/Bridgeplay.app"+ [ -d "$app_src" ] || die "File Bridgeplay yang diunduh tidak berisi Bridgeplay.app. Jalankan Install.command lagi."+ [ "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$app_src/Contents/Info.plist" 2>/dev/null)" = "com.bridgeplay.Bridgeplay" ] \+ || die "File yang diunduh bukan Bridgeplay. Jalankan Install.command lagi."+ codesign --verify --strict "$app_src" 2>/dev/null \+ || die "Tanda tangan Bridgeplay yang diunduh tidak valid. Jalankan Install.command lagi."+fisay "Memasang Bridgeplay..."# quit is asynchronous: wait until the app has gone before its bundle is removed.@@ -59,7 +78,7 @@ while pgrep -qx BridgeplayApp; dowaited=$((waited + 1))donerm -rf /Applications/Bridgeplay.app || die "Bridgeplay lama tidak bisa dihapus dari Applications."-ditto "$here/Bridgeplay.app" /Applications/Bridgeplay.app || die "Bridgeplay gagal disalin ke Applications."+ditto "$app_src" /Applications/Bridgeplay.app || die "Bridgeplay gagal disalin ke Applications."xattr -dr com.apple.quarantine /Applications/Bridgeplay.app 2>/dev/null || trueif [ ! -d /Applications/Steam.app ]; thendiff --git a/scripts/build-local.sh b/scripts/build-local.shindex ca4a017..cbaca44 100755--- a/scripts/build-local.sh+++ b/scripts/build-local.sh@@ -221,6 +221,22 @@ link_test_sparkle() {fi}+# The checks depend on the source, not on the version number, so a tree that already+# passed (a release right after its bump commit) skips them. Only a clean tree is stamped.+# BRIDGEPLAY_FORCE_CHECKS=1 runs them anyway.+checks_stamp=$repo/build/.checks-passed+source_fingerprint() {+ git -C "$repo" diff --quiet HEAD -- 2>/dev/null || return 1+ git -C "$repo" ls-files -s | grep -v ' dylib/version.h$' | shasum | cut -d' ' -f1+}+fingerprint=$(source_fingerprint || true)+if [ "$run_checks" -eq 1 ] && [ -n "$fingerprint" ] && [ "${BRIDGEPLAY_FORCE_CHECKS:-0}" != 1 ] \+ && [ "$(cat "$checks_stamp" 2>/dev/null)" = "$fingerprint" ]; then+ echo "==> [check] skipped: these sources already passed make ci-checks (BRIDGEPLAY_FORCE_CHECKS=1 runs them)"+ run_checks=0+ checks_reused=1+fi+check_failures=""if [ "$run_checks" -eq 1 ]; thencheck_log=$LOG_DIR/checks.log@@ -249,4 +265,9 @@ if [ -n "$check_failures" ]; thenecho "==> checks failed:$check_failures" >&2exit 1fi-[ "$run_checks" -eq 0 ] || echo "==> all CI checks passed"+if [ "$run_checks" -eq 1 ]; then+ echo "==> all CI checks passed"+ [ -z "$fingerprint" ] || printf '%s\n' "$fingerprint" >"$checks_stamp"+elif [ "${checks_reused:-0}" -eq 1 ]; then+ echo "==> all CI checks passed (earlier run, same sources)"+fidiff --git a/scripts/package-installer.sh b/scripts/package-installer.shindex d94d862..3706f97 100755--- a/scripts/package-installer.sh+++ b/scripts/package-installer.sh@@ -1,15 +1,20 @@#!/bin/sh# Assemble the one-click installer zip, out/Bridgeplay-Installer.zip.#-# scripts/package-installer.sh+# scripts/package-installer.sh [--fingerprint-only]#-# Takes out/Bridgeplay.app (make app), the engine archives from this Mac's engine cache,+# The installer carries no app: Install.command downloads the latest Bridgeplay.zip from+# the GitHub releases, so the zip only changes with the engines, GPTK, the configs or the+# installer itself, and release-local.sh uploads it only then. --fingerprint-only runs+# every check and prints that fingerprint without writing the zip.+#+# Takes the engine archives from this Mac's engine cache,# Apple's Game Porting Toolkit from this Mac's support folder, and installer/ plus the# licence files from the repository. Engine archives are checked against the pins in# FreeEngine*.swift. Nothing else from the cache is shipped: Valve's packages and Steam# itself are downloaded on the user's Mac from Valve. GPTK is never committed.#-# Overridable: APP (default out/Bridgeplay.app), ENGINE_CACHE (default+# Overridable: ENGINE_CACHE (default# ~/Library/Caches/bridgeplay), GPTK_DIR (default ~/Library/Application Support/bridgeplay/gptk).# On a Mac the app has not migrated to 3.0.0 yet, the defaults fall back to the old# notproton folders when the bridgeplay ones are missing.@@ -19,7 +24,8 @@ set -eurepo=$(cd "$(dirname "$0")/.." && pwd)cd "$repo"-APP=${APP:-$repo/out/Bridgeplay.app}+fingerprint_only=0+[ "${1:-}" = "--fingerprint-only" ] && fingerprint_only=1if [ -z "${ENGINE_CACHE:-}" ]; thenENGINE_CACHE=$HOME/Library/Caches/bridgeplay[ -d "$ENGINE_CACHE" ] || [ ! -d "$HOME/Library/Caches/notproton" ] || ENGINE_CACHE=$HOME/Library/Caches/notproton@@ -58,14 +64,6 @@ need_file() {[ "$actual" = "$2" ] || die "$1 does not match its pin ($actual, want $2)"}-# --- the app ------------------------------------------------------------------------[ -d "$APP" ] || die "missing $APP, run: make app"-codesign --verify --strict "$APP" || die "$APP fails codesign --verify"-for f in Assets.car Bridgeplay.icns LICENSE NOTICE; do- [ -s "$APP/Contents/Resources/$f" ] || die "$APP has no Contents/Resources/$f, rebuild with: make app"-done-# --- engine archives, from the pins -----------------------------------------------winecx_swift=$models/FreeEngineWinecx.swift@@ -129,7 +127,6 @@ echo "==> staging $stage"rm -rf "$stage_root" "$zip"mkdir -p "$stage/cache/engines/winecx-$runtime"-ditto "$APP" "$stage/Bridgeplay.app"cp installer/Install.command "installer/BACA DULU.txt" installer/README.txt "$stage/"chmod 755 "$stage/Install.command"cp LICENSE LICENSE.* NOTICE "$stage/"@@ -149,6 +146,16 @@ unwanted=$(find "$stage" \( -name valve-packages -o -name 'steam.dmg' -o -name '-o -name '*.p12' -o -name '*.pem' -o -name '*.key' -o -name '.env*' \) -print)[ -z "$unwanted" ] || die "refusing to ship: $unwanted"+# Every staged file's path and content, so the fingerprint moves when anything shipped does.+fingerprint=$(cd "$stage" && find . -type f ! -name .DS_Store -print0 | LC_ALL=C sort -z \+ | xargs -0 shasum -a 256 | shasum -a 256 | cut -d' ' -f1)+if [ "$fingerprint_only" -eq 1 ]; then+ rm -rf "$stage_root"+ echo "$fingerprint"+ exit 0+fi+printf '%s\n' "$fingerprint" >"$repo/out/Bridgeplay-Installer.fingerprint"+# --- zip --------------------------------------------------------------------------echo "==> writing $zip"@@ -156,12 +163,11 @@ echo "==> writing $zip"ditto -c -k --norsrc --noextattr --keepParent "$stage" "$zip"echo "==> contents"-(cd "$stage_root" && find Bridgeplay -maxdepth 3 ! -path 'Bridgeplay/Bridgeplay.app/*' \- ! -path 'Bridgeplay/gptk/*/*' | sort | sed 's/^/ /')+(cd "$stage_root" && find Bridgeplay -maxdepth 3 ! -path 'Bridgeplay/gptk/*/*' | sort | sed 's/^/ /')echo "==> sizes"(cd "$stage" && du -sh -- * | sed 's/^/ /')echo "==> $zip $(du -h "$zip" | cut -f1) ($(stat -f %z "$zip") bytes)"-# The staged copy holds a second Bridgeplay.app that Spotlight would list next to the-# installed one; the zip is the deliverable.+# The zip is the deliverable.rm -rf "$stage_root"+echo "==> fingerprint $fingerprint"diff --git a/scripts/release-local.sh b/scripts/release-local.shindex bc50cde..46d5a70 100755--- a/scripts/release-local.sh+++ b/scripts/release-local.sh@@ -207,18 +207,12 @@ feed "$out/bridgeplay" Bridgeplay.zip Bridgeplay.app "$slug"# installs over /Applications/NotProton.app; later updates match by bundle identifier.[ "$legacy" -eq 0 ] || feed "$out/legacy" NotProton.zip NotProton.app "$legacy_slug"-# bridgeplay.dev's Download links to releases/latest/download/Bridgeplay-Installer.zip, so-# every release that becomes Latest must carry it, built from this same app.-APP=$app scripts/package-installer.sh-mv out/Bridgeplay-Installer.zip "$out/bridgeplay/Bridgeplay-Installer.zip"-title="Bridgeplay $version"body=$(printf '%s\n\nBuild %s, based on NotProton %s.\n' "$notes" "$build" "$upstream")echo "==> $title (build $build), notes since ${previous:-the beginning}:"printf '%s\n' "$notes" | sed 's/^/ /'run gh release create "$tag" "$out/bridgeplay/Bridgeplay.zip" "$out/bridgeplay/appcast.xml" \- "$out/bridgeplay/Bridgeplay-Installer.zip" -R "$slug" \- --target "$(git rev-parse HEAD)" --title "$title" --notes "$body" --latest+ -R "$slug" --target "$(git rev-parse HEAD)" --title "$title" --notes "$body" --latestif [ "$legacy" -eq 1 ]; then# Only a carrier for the feed: the tag goes on that repository's default branch, since# this commit need not exist there. --latest is what moves its feed.@@ -226,6 +220,30 @@ if [ "$legacy" -eq 1 ]; then--title "$title" --notes "NotProton is now Bridgeplay. $body" --latestfi+# bridgeplay.dev's Download (vercel.json /download) points at the fixed "installer"+# release. The installer carries no app (Install.command downloads the Bridgeplay.zip of+# the Latest release, published just above), so it is uploaded only when its fingerprint,+# every file it ships, differs from the one on that release.+installer_tag=installer+installer_fp=$(scripts/package-installer.sh --fingerprint-only | tail -n 1)+published_fp=$(gh release view "$installer_tag" -R "$slug" --json body -q .body 2>/dev/null \+ | sed -n 's/^Fingerprint: //p' || true)+if [ -n "$installer_fp" ] && [ "$installer_fp" = "$published_fp" ]; then+ echo "==> installer unchanged ($installer_fp), not uploaded"+else+ scripts/package-installer.sh+ mv out/Bridgeplay-Installer.zip "$out/bridgeplay/Bridgeplay-Installer.zip"+ installer_body=$(printf 'The one-click installer behind bridgeplay.dev/download. It downloads the latest Bridgeplay when it runs.\n\nFingerprint: %s\n' "$installer_fp")+ if gh release view "$installer_tag" -R "$slug" >/dev/null 2>&1; then+ run gh release upload "$installer_tag" "$out/bridgeplay/Bridgeplay-Installer.zip" -R "$slug" --clobber+ run gh release edit "$installer_tag" -R "$slug" --notes "$installer_body"+ else+ run gh release create "$installer_tag" "$out/bridgeplay/Bridgeplay-Installer.zip" -R "$slug" \+ --target "$(git rev-parse HEAD)" --title "Bridgeplay Installer" --notes "$installer_body" \+ --prerelease --latest=false+ fi+fi+if [ "$dry_run" -eq 1 ]; thenecho "==> dry run: nothing published; zips and appcasts in $out"exit 0