fix(release): changes to the changelog portion so its no longer a link
This commit is contained in:
@@ -9,6 +9,7 @@ import path from "path";
|
||||
import { spawnSync } from "child_process";
|
||||
import { fileURLToPath } from "url";
|
||||
import fetch from "node-fetch";
|
||||
import conventionalChangelog from "conventional-changelog";
|
||||
import dotenv from "dotenv";
|
||||
dotenv.config({ path: "./.env" });
|
||||
|
||||
@@ -60,12 +61,20 @@ if (result.status !== 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Step 2: Read changelog content for current version
|
||||
const changelog = await fs.readFile("CHANGELOG.md", "utf8");
|
||||
const regex = new RegExp(`## \\[${version}\\][\\s\\S]*?(?=## \\[|$)`, "m");
|
||||
const releaseNotes = changelog.match(regex)?.[0] || changelog;
|
||||
const getLatestChangelog = async () => {
|
||||
const changelogStream = conventionalChangelog({
|
||||
preset: "conventionalcommits",
|
||||
releaseCount: 1,
|
||||
});
|
||||
|
||||
console.log(`Release notes for v${version} saved.`);
|
||||
let changelog = "";
|
||||
for await (const chunk of changelogStream) {
|
||||
changelog += chunk;
|
||||
}
|
||||
return changelog;
|
||||
};
|
||||
|
||||
const releaseNotes = await getLatestChangelog();
|
||||
|
||||
// Step 3: Create or update Gitea release
|
||||
const createOrUpdateRelease = async () => {
|
||||
|
||||
Reference in New Issue
Block a user