build: set up versioning with semantic-release

This commit is contained in:
2025-06-23 15:51:49 +03:00
parent e3c73af436
commit 74a1a9d664
7 changed files with 6813 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
const fs = require("fs");
const path = "./manifest.json";
const version = process.env.npm_package_version;
if (!version) {
console.error("Version not found in npm_package_version.");
process.exit(1);
}
const manifest = JSON.parse(fs.readFileSync(path, "utf8"));
manifest.version = version;
fs.writeFileSync(path, JSON.stringify(manifest, null, 2));
console.log(`Updated manifest.json to version ${version}`);