mirror of
https://github.com/gtritchie/bulk-properties.git
synced 2026-07-22 06:08:37 +00:00
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.
14 lines
652 B
JavaScript
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'));
|