One updater for app and server: updater in core; watch-together-server --upgrade / --check-update; update.sh uses the server

The server's version is stamped like the app's (APP_VERSION) when packaged,
so it can compare against the manifest; --upgrade swaps the whole install
folder (app and server) and asks for a restart. update.sh/.bat no longer
need GTK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-09 23:53:52 +03:00
1 parent 059b7dd306
commit 2d39018a73
27 files changed
+382 -171

No files matched your search

+6 -5
View File
@@ -4,10 +4,11 @@
# Usage: tool/package_linux.sh [--skip-build] [--noupload|--no-upload]
# Output: dist/watch-together-<version>-linux-x64.tar.gz containing one
# top-level folder with the executable, lib/ and data/ as built, plus
# update.sh (runs the binary with --upgrade) and watch-together-server (the
# dedicated server, `dart compile exe` of packages/server/bin/server.dart,
# built every run, also with --skip-build). The in-app updater strips
# that top-level folder — keep the layout in sync with updater_test.dart.
# update.sh (runs watch-together-server --upgrade) and watch-together-server
# (the dedicated server, `dart compile exe` of packages/server/bin/server.dart,
# built every run, also with --skip-build; both binaries are stamped with
# APP_VERSION from the app's pubspec). The updater strips
# that top-level folder — keep the layout in sync with packages/core/test/updater_test.dart.
# Upload: set DISCORD_WEBHOOK_URL in the environment (never commit it).
# The tarball must stay under Discord's upload limit (25 MB free tier).
# The upload posts a Components V2 card (flag 1<<15): version header,
@@ -55,7 +56,7 @@ if FLUTTER="$(command -v flutter)"; then
[[ -x "$CANDIDATE" ]] && DART="$CANDIDATE"
fi
(cd "$ROOT/packages/server" && "$DART" pub get >/dev/null &&
"$DART" compile exe bin/server.dart -o "$STAGE/$FOLDER/watch-together-server")
"$DART" compile exe --define=APP_VERSION="$VERSION" bin/server.dart -o "$STAGE/$FOLDER/watch-together-server")
tar -czf "$TARBALL" -C "$STAGE" "$FOLDER"
rm -rf "$STAGE"
ls -la "$TARBALL"
+5 -4
View File
@@ -2,10 +2,11 @@
# Usage: powershell -File tool/package_windows.ps1 [-SkipBuild]
# Output: dist/watch-together-<version>-windows-x64.zip containing one
# top-level folder with watch_together.exe, its DLLs and data/ as built,
# plus update.bat (runs the exe with --upgrade) and
# plus update.bat (runs watch-together-server.exe --upgrade) and
# watch-together-server.exe (dedicated server, `dart compile exe` of
# packages/server/bin/server.dart). Same layout as tool/package_linux.sh;
# the in-app updater strips the top-level folder.
# packages/server/bin/server.dart; both binaries stamped with APP_VERSION).
# Same layout as tool/package_linux.sh; the updater strips the top-level
# folder.
# Needs: flutter on PATH, tar.exe (ships with Windows 10+, writes zip).
param([switch]$SkipBuild)
$ErrorActionPreference = 'Stop'
@@ -45,7 +46,7 @@ Copy-Item "$App/lib/src/update/bundle/update.bat" "$Stage/$Folder/update.bat"
Push-Location (Join-Path $Root 'packages/server')
try {
Invoke-Checked 'dart pub get' { dart pub get | Out-Null }
Invoke-Checked 'dart compile exe' { dart compile exe bin/server.dart -o "$Stage/$Folder/watch-together-server.exe" }
Invoke-Checked 'dart compile exe' { dart compile exe "--define=APP_VERSION=$Version" bin/server.dart -o "$Stage/$Folder/watch-together-server.exe" }
} finally { Pop-Location }
if (Test-Path $Zip) { Remove-Item -Force $Zip }