fix(docs): keep installer links valid across releases

Closes #6403
This commit is contained in:
t8y2
2026-08-17 00:14:43 +08:00
parent e474138696
commit f30d0cb680
3 changed files with 14 additions and 5 deletions
+1
View File
@@ -452,6 +452,7 @@ jobs:
PYEOF
- name: Send to QQ group
continue-on-error: true
env:
SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
HOST: ${{ secrets.DEPLOY_HOST }}
+11 -3
View File
@@ -14,22 +14,30 @@ test("Windows downloads include standard, offline, and Windows 7 installers", ()
label: "Windows 10/11 (x64)",
description: "标准在线安装包",
badge: "推荐",
href: "https://dl.dbxio.com/releases/latest/DBX_0.5.82_x64-setup.exe?v=0.5.82",
href: "https://dl.dbxio.com/releases/v0.5.82/DBX_0.5.82_x64-setup.exe?v=0.5.82",
},
{
id: "windows-offline",
label: "Windows 完整离线安装包",
description: "内置 WebView2 · 适用于内网部署或运行库缺失",
badge: "离线",
href: "https://dl.dbxio.com/releases/latest/DBX_0.5.82_x64-webview2-offline-setup.exe?v=0.5.82",
href: "https://dl.dbxio.com/releases/v0.5.82/DBX_0.5.82_x64-webview2-offline-setup.exe?v=0.5.82",
},
{
id: "windows-7-offline",
label: "Windows 7 离线安装包",
description: "内置 WebView2 109 · 仅支持 x64",
badge: "旧系统",
href: "https://dl.dbxio.com/releases/latest/DBX_0.5.82_x64-win7-webview2-109-offline-setup.exe?v=0.5.82",
href: "https://dl.dbxio.com/releases/v0.5.82/DBX_0.5.82_x64-win7-webview2-109-offline-setup.exe?v=0.5.82",
},
],
);
});
test("all downloads use immutable versioned release paths", () => {
const options = createInstallOptions("en", "0.5.82");
assert.equal(options.length, 7);
assert.ok(options.every((option) => option.href.startsWith("https://dl.dbxio.com/releases/v0.5.82/DBX_0.5.82_")));
assert.ok(options.every((option) => !option.href.includes("/releases/latest/")));
});
+2 -2
View File
@@ -18,7 +18,7 @@ type DownloadArtifact = {
suffix: string;
};
const DOWNLOAD_BASE_URL = "https://dl.dbxio.com/releases/latest";
const DOWNLOAD_BASE_URL = "https://dl.dbxio.com/releases";
const downloadArtifacts: DownloadArtifact[] = [
{
@@ -78,6 +78,6 @@ export function createInstallOptions(lang: InstallLang, version: string): Instal
label: artifact.labels[lang],
description: artifact.descriptions?.[lang],
badge: artifact.badges?.[lang],
href: `${DOWNLOAD_BASE_URL}/DBX_${version}_${artifact.suffix}?v=${version}`,
href: `${DOWNLOAD_BASE_URL}/v${version}/DBX_${version}_${artifact.suffix}?v=${version}`,
}));
}