summaryrefslogtreecommitdiff
path: root/tools/release
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-30 17:09:07 -0400
committerGitHub <noreply@github.com>2023-05-30 17:09:07 -0400
commit047edf6a75133decf069e6118634caa76a455d7c (patch)
tree2045b050ade0f401f1a6074b1187170f5eb98d0e /tools/release
parent42a3f52e983e6b37ac1f69733a9347505e061e43 (diff)
ci: bump CI cache version on CLI version bump (#19318)
Automatically bump the CI cache version
Diffstat (limited to 'tools/release')
-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}`;
+}