|
@@ -1,9 +1,11 @@
|
|
import fs from "fs-extra";
|
|
import fs from "fs-extra";
|
|
import { createRequire } from "module";
|
|
import { createRequire } from "module";
|
|
import { execSync } from "child_process";
|
|
import { execSync } from "child_process";
|
|
|
|
+import { resolveUpdateLog } from "./updatelog.mjs";
|
|
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const require = createRequire(import.meta.url);
|
|
|
|
|
|
|
|
+// publish
|
|
async function resolvePublish() {
|
|
async function resolvePublish() {
|
|
const flag = process.argv[2] ?? "patch";
|
|
const flag = process.argv[2] ?? "patch";
|
|
const packageJson = require("../package.json");
|
|
const packageJson = require("../package.json");
|
|
@@ -26,6 +28,10 @@ async function resolvePublish() {
|
|
packageJson.version = nextVersion;
|
|
packageJson.version = nextVersion;
|
|
tauriJson.package.version = nextVersion;
|
|
tauriJson.package.version = nextVersion;
|
|
|
|
|
|
|
|
+ // 发布更新前先写更新日志
|
|
|
|
+ const nextTag = `v${nextVersion}`;
|
|
|
|
+ await resolveUpdateLog(nextTag);
|
|
|
|
+
|
|
await fs.writeFile(
|
|
await fs.writeFile(
|
|
"./package.json",
|
|
"./package.json",
|
|
JSON.stringify(packageJson, undefined, 2)
|
|
JSON.stringify(packageJson, undefined, 2)
|