feat: switch extension updates to COS

This commit is contained in:
2026-05-25 10:32:39 +08:00
parent 8fa9fc4469
commit 57e4dc72aa
10 changed files with 205 additions and 21 deletions
+5 -11
View File
@@ -2,6 +2,7 @@ import { mkdir, writeFile } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { createManifest } from "./manifest.mjs";
import { createLatestManifest } from "./write-latest-manifest-data.mjs";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -11,19 +12,12 @@ const releaseManifest = createManifest({ target: "release" });
const latestVersion = process.env.LATEST_VERSION ?? releaseManifest.version;
const publicBaseUrl =
process.env.UPDATE_PUBLIC_BASE_URL ??
`https://example.com/star-chart-search-enhancer/releases/${latestVersion}`;
const latestManifest = {
guideUrl: `${publicBaseUrl}/星图增强插件-超简单安装使用指南.pdf`,
`https://wksgx-1343191620.cos.ap-nanjing.myqcloud.com/star-chart-search-enhancer/releases/${latestVersion}`;
const latestManifest = createLatestManifest({
latestVersion,
minSupportedVersion: releaseManifest.version,
publishedAt: new Date().toISOString().slice(0, 10),
releaseNotes: [
"支持在插件弹窗中检查新版本",
"支持一键下载最新版插件压缩包和使用说明"
],
zipUrl: `${publicBaseUrl}/star-chart-search-enhancer-internal.zip`
};
publicBaseUrl
});
await mkdir(releaseDir, { recursive: true });
await writeFile(