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.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 5ab4011a-b584-477f-8d7b-208977da4a87
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/IO8TMSC
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
riyadhafraa
2026-05-19 14:21:09 +00:00
parent c0f4a84c93
commit dd9a97d6d7
+9 -13
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(
// 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}`,
);
}
);