feat: switch extension updates to COS
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export function createLatestManifest(options) {
|
||||
const publishedAt = options.publishedAt ?? new Date().toISOString().slice(0, 10);
|
||||
|
||||
return {
|
||||
guideUrl: `${options.publicBaseUrl}/星图增强插件-超简单安装使用指南.pdf`,
|
||||
latestVersion: options.latestVersion,
|
||||
minSupportedVersion: options.minSupportedVersion,
|
||||
publishedAt,
|
||||
releaseNotes: [
|
||||
"支持在插件弹窗中检查新版本",
|
||||
"支持一键下载最新版插件压缩包和使用说明"
|
||||
],
|
||||
zipUrl: `${options.publicBaseUrl}/star-chart-search-enhancer-internal.zip`
|
||||
};
|
||||
}
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user