[fix] validate desktop artifact versions against release tags

This commit is contained in:
dijunkun
2026-10-21 23:10:14 +08:00
parent 6abcafc205
commit 941de898fb
2 changed files with 15 additions and 0 deletions
@@ -152,6 +152,15 @@ def merge_release(current, tag, name, notes, downloads, published_date=None):
if not tag.startswith("v"):
raise ValueError(f"Expected a version tag, got {tag!r}")
metadata = version_info(tag, published_date)
# Clients require the full artifact version to match the advertised
# desktop version, including its date and patch spelling.
for platform, download in downloads.items():
if (platform.startswith(("windows-", "macos-", "linux-"))
and download["version"] != metadata["version"]):
raise ValueError(
f"Desktop release {tag} expects version {metadata['version']}, "
f"but {platform} artifact {download['filename']} "
f"has version {download['version']}")
current_order = release_order(current)
if current_order is not None and release_order(metadata) < current_order:
current_version = current.get("latest_version") or current.get("version")
+6
View File
@@ -64,6 +64,12 @@ GitHub Actions 从分支手动打包时,在 `Build and Release` 的
同版本仍可更新发布说明,新版本正常发布。各平台下载记录也不会被较低
版本覆盖,包括独立移动端发布和桌面 Release 附带的移动端安装包。
桌面 Release 中所有桌面安装包及便携包的完整版本必须与标签去掉 `v`
前缀后的版本一致,包括日期和 patch 的位置;不能只按数字版本比较。
任一包不匹配时,脚本报告标签、平台、文件名及双方版本,终止清单生成,
不写入输出文件。手动发布时应使用与安装包一致的完整版本标签,例如
`v1.7.4-20261021`。iOS、Android 安装包保持独立版本。
本地构建可以设置同名环境变量,或使用:
```sh