8 lines
413 B
JavaScript
8 lines
413 B
JavaScript
import { readFileSync } from "node:fs";
|
|
const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
const ref = process.env.RELEASE_REF;
|
|
if (!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(version) || ref !== `refs/tags/v${version}`) {
|
|
throw new Error("Release tag must be vX.Y.Z and match the stable version in package.json");
|
|
}
|
|
console.log(`version=${version}`);
|