mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
feat: add Changelog.md and update scripts to reference it
- Created a new Changelog.md file to document version updates and changes. - Updated the updatelog.mjs script to parse Changelog.md instead of UPDATELOG.md. - Modified updater-fixed-webview2.mjs to use the new Changelog.md for update notes.
This commit is contained in:
@@ -2,9 +2,9 @@ import fs from "fs";
|
||||
import fsp from "fs/promises";
|
||||
import path from "path";
|
||||
|
||||
const UPDATE_LOG = "UPDATELOG.md";
|
||||
const UPDATE_LOG = "Changelog.md";
|
||||
|
||||
// parse the UPDATELOG.md
|
||||
// parse the Changelog.md
|
||||
export async function resolveUpdateLog(tag) {
|
||||
const cwd = process.cwd();
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function resolveUpdateLog(tag) {
|
||||
const file = path.join(cwd, UPDATE_LOG);
|
||||
|
||||
if (!fs.existsSync(file)) {
|
||||
throw new Error("could not found UPDATELOG.md");
|
||||
throw new Error("could not found Changelog.md");
|
||||
}
|
||||
|
||||
const data = await fsp.readFile(file, "utf-8");
|
||||
@@ -38,7 +38,7 @@ export async function resolveUpdateLog(tag) {
|
||||
});
|
||||
|
||||
if (!map[tag]) {
|
||||
throw new Error(`could not found "${tag}" in UPDATELOG.md`);
|
||||
throw new Error(`could not found "${tag}" in Changelog.md`);
|
||||
}
|
||||
|
||||
return map[tag].join("\n").trim();
|
||||
@@ -49,7 +49,7 @@ export async function resolveUpdateLogDefault() {
|
||||
const file = path.join(cwd, UPDATE_LOG);
|
||||
|
||||
if (!fs.existsSync(file)) {
|
||||
throw new Error("could not found UPDATELOG.md");
|
||||
throw new Error("could not found Changelog.md");
|
||||
}
|
||||
|
||||
const data = await fsp.readFile(file, "utf-8");
|
||||
@@ -77,7 +77,7 @@ export async function resolveUpdateLogDefault() {
|
||||
}
|
||||
|
||||
if (!firstTag) {
|
||||
throw new Error("could not found any version tag in UPDATELOG.md");
|
||||
throw new Error("could not found any version tag in Changelog.md");
|
||||
}
|
||||
|
||||
return content.join("\n").trim();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getOctokit, context } from "@actions/github";
|
||||
import { context, getOctokit } from "@actions/github";
|
||||
import fetch from "node-fetch";
|
||||
|
||||
import { resolveUpdateLog } from "./updatelog.mjs";
|
||||
@@ -36,7 +36,7 @@ async function resolveUpdater() {
|
||||
|
||||
const updateData = {
|
||||
name: tag.name,
|
||||
notes: await resolveUpdateLog(tag.name), // use updatelog.md
|
||||
notes: await resolveUpdateLog(tag.name), // use Changelog.md
|
||||
pub_date: new Date().toISOString(),
|
||||
platforms: {
|
||||
"windows-x86_64": { signature: "", url: "" },
|
||||
|
||||
Reference in New Issue
Block a user