Update versioning to increment on every deployment

Modify `scripts/update-version.mjs` to always increment the deploy count and version number on each build or redeploy, regardless of commit changes.
This commit is contained in:
Riyadh
2026-05-19 14:21:09 +00:00
parent 6daef87389
commit 028fe9469e
+10 -14
View File
@@ -54,17 +54,13 @@ let deployCount = Number.isInteger(current.deployCount)
return m ? parseInt(m[1], 10) : 0;
})();
if (current.build === build) {
// No new commit since last run -> nothing to do. Don't bump the
// counter and don't rewrite the file. This matches pre-#597 behaviour
// so re-running the build twice in CI doesn't inflate the counter.
console.log(`[update-version] build unchanged: ${build}`);
} else {
deployCount += 1;
const version = `${baseVersion}.${deployCount}`;
const next = { baseVersion, version, build, deployCount };
writeFileSync(versionPath, JSON.stringify(next, null, 2) + "\n");
console.log(
`[update-version] ${current.build} -> ${build} | ${current.version ?? "<none>"} -> ${version}`,
);
}
// Always bump on every build/redeploy, even when the commit hash hasn't
// changed. The user wants the version label to reflect every deploy so
// they can confirm a redeploy actually rolled out new code on the Mac.
deployCount += 1;
const version = `${baseVersion}.${deployCount}`;
const next = { baseVersion, version, build, deployCount };
writeFileSync(versionPath, JSON.stringify(next, null, 2) + "\n");
console.log(
`[update-version] ${current.build} -> ${build} | ${current.version ?? "<none>"} -> ${version}`,
);