chore: update "version_bump" action to allow for RC bumps (#29048)

Also fixes the script for other version updates that was missed in
https://github.com/denoland/deno/pull/29018.
This commit is contained in:
Bartek Iwańczuk 2025-04-25 17:15:16 +02:00 committed by GitHub
parent f9a024a748
commit 5c3bb07460
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 2 deletions

View file

@ -11,6 +11,7 @@ on:
- patch
- minor
- major
- rc
required: true
jobs:

View file

@ -10,6 +10,25 @@ const denoRtCrate = workspace.getDenoRtCrate();
const denoLibCrate = workspace.getDenoLibCrate();
const originalCliVersion = cliCrate.version;
if (Deno.args.some((a) => a === "--rc")) {
const cliVersion = semver.parse(cliCrate.version)!;
if (cliVersion.prerelease[0] != "rc") {
cliVersion.increment("minor");
}
cliVersion.increment("pre", "rc");
const version = cliVersion.toString();
await cliCrate.setVersion(version);
await denoRtCrate.setVersion(version);
await denoLibCrate.setVersion(version);
// Force lockfile update
await workspace.getCliCrate().cargoUpdate("--workspace");
Deno.exit(0);
}
await bumpCiCacheVersion();
// increment the cli version
@ -23,8 +42,8 @@ if (Deno.args.some((a) => a === "--patch")) {
await cliCrate.promptAndIncrement();
}
denoRtCrate.setVersion(cliCrate.version);
denoLibCrate.folderPath.join("version.txt").writeTextSync(cliCrate.version);
await denoRtCrate.setVersion(cliCrate.version);
await denoLibCrate.setVersion(cliCrate.version);
// increment the dependency crate versions
for (const crate of workspace.getCliDependencyCrates()) {