summaryrefslogtreecommitdiff
path: root/tools/release/01_bump_crate_versions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/release/01_bump_crate_versions.ts')
-rwxr-xr-xtools/release/01_bump_crate_versions.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/release/01_bump_crate_versions.ts b/tools/release/01_bump_crate_versions.ts
index d9c67a817..c709ccc80 100755
--- a/tools/release/01_bump_crate_versions.ts
+++ b/tools/release/01_bump_crate_versions.ts
@@ -8,6 +8,8 @@ const repo = workspace.repo;
const cliCrate = workspace.getCliCrate();
const originalCliVersion = cliCrate.version;
+await bumpCiCacheVersion();
+
// increment the cli version
if (Deno.args.some((a) => a === "--patch")) {
await cliCrate.increment("patch");
@@ -110,3 +112,25 @@ async function updateStdVersion() {
text.replace(versionRe, `std@${newStdVersion}`),
);
}
+
+async function bumpCiCacheVersion() {
+ const generateScript = workspace.repo.folderPath.join(
+ ".github/workflows/ci.generate.ts",
+ );
+ const fileText = generateScript.readTextSync();
+ const cacheVersionRegex = /const cacheVersion = ([0-9]+);/;
+ const version = fileText.match(cacheVersionRegex)?.[1];
+ if (version == null) {
+ throw new Error("Could not find cache version in text.");
+ }
+ const toVersion = parseInt(version, 10) + 1;
+ $.logStep(`Bumping cache version from ${version} to ${toVersion}...`);
+ const newText = fileText.replace(
+ cacheVersionRegex,
+ `const cacheVersion = ${toVersion};`,
+ );
+ generateScript.writeTextSync(newText);
+
+ // run the script
+ await $`${generateScript}`;
+}