summaryrefslogtreecommitdiff
path: root/core/updater.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/updater.py')
-rw-r--r--core/updater.py31
1 files changed, 25 insertions, 6 deletions
diff --git a/core/updater.py b/core/updater.py
index 471ef0b..bbd1bf9 100644
--- a/core/updater.py
+++ b/core/updater.py
@@ -7,11 +7,16 @@ is_frozen()); calling check_for_update()/apply_update() from a
`python main.py` dev run raises, since there's no installed bundle for
tufup to update.
-Update metadata/targets are hosted on this repo's "updates" GitHub Release
-— a fixed tag that never changes between app versions, unlike a normal
-per-version release tag, because TUF's top-level metadata (timestamp.json,
-snapshot.json, ...) must live at a stable URL the client always checks.
-See scripts/release/README.md for the publishing side.
+Update metadata/targets are hosted on this repo's "updates-<platform>"
+GitHub Release — a fixed tag per platform (never changes between app
+versions of that platform), because TUF's top-level metadata
+(timestamp.json, snapshot.json, ...) must live at a stable URL the client
+always checks. Separate tags per platform (not one shared "updates" tag)
+because a Windows build and a Linux build of the same app version are
+different byte-for-byte archives — TUF metadata filenames aren't
+platform-prefixed, so they can't share one release without one platform's
+metadata silently overwriting the other's. See scripts/release/README.md
+for the publishing side.
"""
import sys
@@ -23,7 +28,21 @@ from core.version import __version__ as CURRENT_VERSION
APP_NAME = "labui"
-_RELEASE_BASE_URL = "https://github.com/c-kolset/labUI-python/releases/download/updates/"
+
+def _platform_key() -> str:
+ """win / mac / linux — must match scripts/release/<key>/ on the
+ publishing side and the "updates-<key>" release tag."""
+ if sys.platform.startswith("win"):
+ return "win"
+ if sys.platform == "darwin":
+ return "mac"
+ return "linux"
+
+
+_RELEASE_BASE_URL = (
+ f"https://github.com/c-kolset/labUI-python/releases/download/"
+ f"updates-{_platform_key()}/"
+)
METADATA_BASE_URL = _RELEASE_BASE_URL
TARGET_BASE_URL = _RELEASE_BASE_URL