feat(cli): add alchemy and improve cli tooling and structure (#520)

This commit is contained in:
Aman Varshney
2025-08-20 23:43:58 +05:30
committed by GitHub
parent c5430ae4fd
commit 5788876c47
152 changed files with 5804 additions and 2264 deletions

38
scripts/release.ts Normal file
View File

@@ -0,0 +1,38 @@
import { readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
import { $ } from "bun";
import { generate } from "changelogithub";
import config from "../changelogithub.config";
async function main(): Promise<void> {
const tag = process.env.GITHUB_REF?.replace("refs/tags/", "");
if (!tag) {
console.error("No git tag found");
process.exit(1);
}
console.log(`Generating changelog for ${tag}`);
const changelog = await generate({
to: tag,
...config,
});
const changelogPath = join(process.cwd(), "CHANGELOG.md");
let existingContent = "";
try {
existingContent = await readFile(changelogPath, "utf-8");
} catch {}
const newChangelog = `## ${tag}\n\n${changelog.md}\n\n---\n\n${existingContent}`;
await writeFile(changelogPath, newChangelog);
await $`git add CHANGELOG.md`;
await $`git commit -m "chore: update changelog for ${tag}"`;
await $`git push`;
console.log(`✅ Generated changelog for ${tag}`);
}
main().catch(console.error);