From 5a8f810887d4d0f4317b67ef0bc16bd3d3a39bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Thu, 6 Aug 2026 15:23:11 +0200 Subject: [PATCH] fix(downloads): never surface research-edition releases as the beta Research builds (e.g. v0.14.0b3-research) are published as prereleases on the same repo, so the newest-prerelease pick would offer them to regular beta users. Allowlist standard version tags instead. --- scripts/update-downloads.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/update-downloads.py b/scripts/update-downloads.py index 88ab5644..272663fd 100755 --- a/scripts/update-downloads.py +++ b/scripts/update-downloads.py @@ -20,6 +20,11 @@ API = "https://api.github.com/repos/ActivityWatch/activitywatch/releases" +# Only standard-edition tags. Suffixed variants like v0.14.0b3-research are +# also flagged prerelease on GitHub but must never be surfaced as the site's +# beta — an allowlist keeps any future suffixed variant out too. +STANDARD_TAG = re.compile(r"^v\d+\.\d+\.\d+(?:(?:a|b|rc)\d+)?$") + # Static (non-GitHub) distribution links, appended per platform for the stable # release only — package managers and the Play Store track stable, not betas. PACKAGE_LINKS = { @@ -125,9 +130,11 @@ def is_older(dt: str, td: timedelta) -> bool: if not isinstance(releases, list): raise SystemExit(f"Unexpected GitHub API response (not a release list): {releases}") - # Ignore drafts and anything <1h old (assets may still be uploading). + # Ignore drafts, anything <1h old (assets may still be uploading), and + # non-standard editions (research builds etc.). releases = [r for r in releases - if not r["draft"] and is_older(r["created_at"], timedelta(hours=1))] + if not r["draft"] and is_older(r["created_at"], timedelta(hours=1)) + and STANDARD_TAG.match(r["tag_name"])] releases.sort(key=lambda r: r["created_at"]) stable = [r for r in releases if not r["prerelease"]]