forked from Foxyz/sync_replay_project
Restructure step R: the app is Starsync (dev.foxyz.starsync)
- Linux app id dev.foxyz.starsync, binary starsync; Windows starsync.exe, company foxyz; server starsync-server; Dart package starsync; archives starsync-<ver>-*. - 1.2.x compatibility: watch_together and watch-together-server launchers (Linux) / copies (Windows) in the archive; the updater accepts both names and relaunches the new binary; update.sh/.bat use whichever server exists. - First start copies (never moves) the old support folder and this app's Hive boxes out of ~/Documents into <support>/hive; a marker makes it run once; AppDirs is a port; settings schema version with ordered migrations. - Launcher entry dev.foxyz.starsync.desktop; the old one removed. - Repository name and URLs unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f4ca02c3cf
commit
51c1c5ab78
96 files changed
+1169
-489
No files matched your search
+2
-2
@@ -55,7 +55,7 @@ export VERSION="$NEXT-dev.$N"
|
||||
echo "building $VERSION (last published: ${LAST:-none})"
|
||||
|
||||
"$ROOT/tool/package_linux.sh" --no-upload
|
||||
TARBALL="$ROOT/dist/watch-together-$VERSION-linux-x64.tar.gz"
|
||||
TARBALL="$ROOT/dist/starsync-$VERSION-linux-x64.tar.gz"
|
||||
[[ -f "$TARBALL" ]] || { echo "error: $TARBALL missing" >&2; exit 1; }
|
||||
|
||||
NOTES="$(git -C "$ROOT" log -1 --format=%s)"
|
||||
@@ -90,5 +90,5 @@ cat <<EOF
|
||||
|
||||
Published $VERSION. Dev builds pick it up with their next update check.
|
||||
A stable install moves onto test builds once: with the app open, run (bash)
|
||||
p=\$(pgrep -xo watch_together) && d=\$(dirname "\$(readlink /proc/\$p/exe)") && t=\$(mktemp -d) && curl -fsSL $BASE_URL/$(basename "$TARBALL") | tar -xz -C "\$t" --strip-components=1 && cp -rf --remove-destination "\$t"/. "\$d"/ && rm -rf "\$t" && echo "Done: restart the app." || echo "Failed: is the app open?"
|
||||
p=\$(pgrep -xo 'starsync|watch_together') && d=\$(dirname "\$(readlink /proc/\$p/exe)") && t=\$(mktemp -d) && curl -fsSL $BASE_URL/$(basename "$TARBALL") | tar -xz -C "\$t" --strip-components=1 && cp -rf --remove-destination "\$t"/. "\$d"/ && rm -rf "\$t" && echo "Done: restart the app." || echo "Failed: is the app open?"
|
||||
EOF
|
||||
+16
-11
@@ -2,13 +2,16 @@
|
||||
# Package the Linux release bundle into a versioned tar.gz and optionally
|
||||
# upload it to Discord.
|
||||
# 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 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.
|
||||
# Output: dist/starsync-<version>-linux-x64.tar.gz containing one
|
||||
# top-level folder starsync-<version>/ with the executable `starsync`, lib/
|
||||
# and data/ as built, plus update.sh (runs starsync-server --upgrade) and
|
||||
# starsync-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), and
|
||||
# the launchers `watch_together` and `watch-together-server` (the names up
|
||||
# to 1.2.x: their updater restarts `watch_together`, VPS units run the old
|
||||
# server name). 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,
|
||||
@@ -28,7 +31,7 @@ done
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
APP="$ROOT/apps/desktop"
|
||||
NAME="watch-together"
|
||||
NAME="starsync"
|
||||
ARCH="x64"
|
||||
|
||||
# VERSION in the environment overrides it (tool/dev_release.sh).
|
||||
@@ -56,7 +59,9 @@ TARBALL="$DIST/$FOLDER-linux-$ARCH.tar.gz"
|
||||
rm -rf "$STAGE"
|
||||
mkdir -p "$STAGE/$FOLDER" "$DIST"
|
||||
cp -r "$BUNDLE/." "$STAGE/$FOLDER/"
|
||||
install -m 755 "$APP/lib/src/update/bundle/update.sh" "$STAGE/$FOLDER/update.sh"
|
||||
for f in update.sh watch_together watch-together-server; do
|
||||
install -m 755 "$APP/lib/src/update/bundle/$f" "$STAGE/$FOLDER/$f"
|
||||
done
|
||||
# Prefer the dart bundled with the Flutter SDK that builds the app.
|
||||
DART="dart"
|
||||
if FLUTTER="$(command -v flutter)"; then
|
||||
@@ -64,7 +69,7 @@ if FLUTTER="$(command -v flutter)"; then
|
||||
[[ -x "$CANDIDATE" ]] && DART="$CANDIDATE"
|
||||
fi
|
||||
(cd "$ROOT/packages/server" && "$DART" pub get >/dev/null &&
|
||||
"$DART" compile exe --define=APP_VERSION="$VERSION" bin/server.dart -o "$STAGE/$FOLDER/watch-together-server")
|
||||
"$DART" compile exe --define=APP_VERSION="$VERSION" bin/server.dart -o "$STAGE/$FOLDER/starsync-server")
|
||||
tar -czf "$TARBALL" -C "$STAGE" "$FOLDER"
|
||||
rm -rf "$STAGE"
|
||||
ls -la "$TARBALL"
|
||||
@@ -119,7 +124,7 @@ payload = {
|
||||
'accent_color': 5793266,
|
||||
'components': [
|
||||
{'type': 10, 'content':
|
||||
f'# 📦 watch-together `{ver}`\n'
|
||||
f'# 📦 Starsync `{ver}`\n'
|
||||
f'-# linux · {arch} · release · {size_mb:.1f} MB'},
|
||||
{'type': 10, 'content': f'`{commit[:140]}`'},
|
||||
{'type': 10, 'content': block[:1500]},
|
||||
|
||||
+14
-10
@@ -1,19 +1,21 @@
|
||||
# Package the Windows release bundle into a versioned zip.
|
||||
# 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 watch-together-server.exe --upgrade) and
|
||||
# watch-together-server.exe (dedicated server, `dart compile exe` of
|
||||
# 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.
|
||||
# Output: dist/starsync-<version>-windows-x64.zip containing one
|
||||
# top-level folder starsync-<version>/ with starsync.exe, its DLLs and
|
||||
# data/ as built, plus update.bat (runs starsync-server.exe --upgrade) and
|
||||
# starsync-server.exe (dedicated server, `dart compile exe` of
|
||||
# packages/server/bin/server.dart; both binaries stamped with APP_VERSION),
|
||||
# and copies of both under the names up to 1.2.x (watch_together.exe,
|
||||
# watch-together-server.exe: a 1.2.x updater checks for and restarts its
|
||||
# own name). 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'
|
||||
|
||||
$Root = Split-Path -Parent $PSScriptRoot
|
||||
$App = Join-Path $Root 'apps/desktop'
|
||||
$Name = 'watch-together'
|
||||
$Name = 'starsync'
|
||||
$Arch = 'x64'
|
||||
|
||||
$Version = (Select-String -Path "$App/pubspec.yaml" -Pattern '^version: ([0-9.]+)').Matches[0].Groups[1].Value
|
||||
@@ -58,7 +60,7 @@ if (-not $SkipBuild) {
|
||||
}
|
||||
|
||||
$Bundle = Join-Path $App "build/windows/$Arch/runner/Release"
|
||||
if (-not (Test-Path "$Bundle/watch_together.exe")) { throw "bundle missing (build first): $Bundle" }
|
||||
if (-not (Test-Path "$Bundle/starsync.exe")) { throw "bundle missing (build first): $Bundle" }
|
||||
|
||||
$Stage = Join-Path $App 'build/package-stage'
|
||||
$Dist = Join-Path $Root 'dist'
|
||||
@@ -68,12 +70,14 @@ if (Test-Path $Stage) { Remove-Item -Recurse -Force $Stage }
|
||||
New-Item -ItemType Directory -Force "$Stage/$Folder", $Dist | Out-Null
|
||||
Copy-Item -Recurse "$Bundle/*" "$Stage/$Folder/"
|
||||
Copy-Item "$App/lib/src/update/bundle/update.bat" "$Stage/$Folder/update.bat"
|
||||
Copy-Item "$Stage/$Folder/starsync.exe" "$Stage/$Folder/watch_together.exe"
|
||||
|
||||
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 "--define=APP_VERSION=$Version" 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/starsync-server.exe" }
|
||||
} finally { Pop-Location }
|
||||
Copy-Item "$Stage/$Folder/starsync-server.exe" "$Stage/$Folder/watch-together-server.exe"
|
||||
|
||||
if (Test-Path $Zip) { Remove-Item -Force $Zip }
|
||||
# bsdtar writes forward-slash entry names (Compress-Archive on 5.1 doesn't).
|
||||
|
||||
+2
-2
@@ -55,11 +55,11 @@ PROTO="$(sed -n 's/.*protoVersion = \([0-9]*\).*/\1/p' "$ROOT/packages/core/lib/
|
||||
if [[ -n "$LATEST" && "$LATEST" != "v$VER" ]]; then
|
||||
NOTES="$(git -C "$ROOT" log -n 20 "$LATEST..HEAD" --format='- %s')"
|
||||
else
|
||||
NOTES="Watch together $VER."
|
||||
NOTES="Starsync $VER."
|
||||
fi
|
||||
export MANIFEST_FILE="$ROOT/updates/manifest.json" MANIFEST_VER="$VER" \
|
||||
MANIFEST_PROTO="$PROTO" MANIFEST_NOTES="$NOTES" \
|
||||
MANIFEST_BASE="$SERVER/$REPO/releases/download/v$VER/watch-together-$VER"
|
||||
MANIFEST_BASE="$SERVER/$REPO/releases/download/v$VER/starsync-$VER"
|
||||
python3 - <<'EOF'
|
||||
import json, os
|
||||
path = os.environ['MANIFEST_FILE']
|
||||
|
||||
@@ -45,7 +45,7 @@ Future<void> main(List<String> args) async {
|
||||
final prev = _git(root, ['describe', '--tags', '--abbrev=0', '$tag^'],
|
||||
allowFail: true);
|
||||
final notes = prev.isEmpty
|
||||
? 'Watch together $ver.'
|
||||
? 'Starsync $ver.'
|
||||
: _git(root, [
|
||||
'log',
|
||||
'$prev..$tag',
|
||||
@@ -63,7 +63,7 @@ Future<void> main(List<String> args) async {
|
||||
rel = await c.post('$api/releases', {
|
||||
'tag_name': tag,
|
||||
'name': tag,
|
||||
'body': 'Watch together $ver\n\n$notes',
|
||||
'body': 'Starsync $ver\n\n$notes',
|
||||
'draft': false,
|
||||
'prerelease': false,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user