gtritchie_bulk-properties/version-bump.mjs
Gary Ritchie 62dd025f1f
Remove unneeded permissions prerequisite, fix version bump
The release workflow declares its own permissions at the job
level, so the repo-wide setting doesn't need to be changed.

Fix version-bump.mjs to always write the new version entry to
versions.json. Previously it skipped the write when minAppVersion
already existed as a value, which meant most patch/minor releases
wouldn't get recorded.
2026-03-28 15:21:21 -06:00

14 lines
652 B
JavaScript

import { readFileSync, writeFileSync } from "fs";
const targetVersion = process.env.npm_package_version;
// read minAppVersion from manifest.json and bump version to target version
const manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
const { minAppVersion } = manifest;
manifest.version = targetVersion;
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
// update versions.json with target version and minAppVersion from manifest.json
const versions = JSON.parse(readFileSync('versions.json', 'utf8'));
versions[targetVersion] = minAppVersion;
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));