From 92bb25105822d0def65aa89ee5141c862ac7a3e4 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 16 Mar 2022 20:33:14 -0400 Subject: [PATCH] chore: release script should automatically figure out CLI crate dependencies (#13992) --- tools/release/01_bump_crate_versions.ts | 2 +- tools/release/02_publish_crates.ts | 4 ++- tools/release/deno_workspace.ts | 35 ++++--------------------- tools/release/deps.ts | 2 +- 4 files changed, 10 insertions(+), 33 deletions(-) diff --git a/tools/release/01_bump_crate_versions.ts b/tools/release/01_bump_crate_versions.ts index a29bdd554f..eea49279f3 100755 --- a/tools/release/01_bump_crate_versions.ts +++ b/tools/release/01_bump_crate_versions.ts @@ -12,7 +12,7 @@ const originalCliVersion = cliCrate.version; await cliCrate.promptAndIncrement(); // increment the dependency crate versions -for (const crate of workspace.getDependencyCrates()) { +for (const crate of workspace.getCliDependencyCrates()) { await crate.increment("minor"); } diff --git a/tools/release/02_publish_crates.ts b/tools/release/02_publish_crates.ts index 1bb02f4608..5910827c35 100755 --- a/tools/release/02_publish_crates.ts +++ b/tools/release/02_publish_crates.ts @@ -6,7 +6,9 @@ import { getCratesPublishOrder } from "./deps.ts"; const workspace = await DenoWorkspace.load(); const cliCrate = workspace.getCliCrate(); -const dependencyCrates = getCratesPublishOrder(workspace.getDependencyCrates()); +const dependencyCrates = getCratesPublishOrder( + workspace.getCliDependencyCrates(), +); try { for (const [i, crate] of dependencyCrates.entries()) { diff --git a/tools/release/deno_workspace.ts b/tools/release/deno_workspace.ts index 19c8f99983..6f5b64590e 100644 --- a/tools/release/deno_workspace.ts +++ b/tools/release/deno_workspace.ts @@ -28,42 +28,17 @@ export class DenoWorkspace { return this.#repo.crates; } - /** Gets the dependency crates used for the first part of the release process. */ - getDependencyCrates() { - return [ - this.getBenchUtilCrate(), - this.getSerdeV8Crate(), - this.getCoreCrate(), - ...this.getExtCrates(), - this.getRuntimeCrate(), - ]; - } - - getSerdeV8Crate() { - return this.getCrate("serde_v8"); + /** Gets the CLI dependency crates that should be published. */ + getCliDependencyCrates() { + return this.getCliCrate() + .descendantDependenciesInRepo() + .filter((c) => c.name !== "test_util"); } getCliCrate() { return this.getCrate("deno"); } - getCoreCrate() { - return this.getCrate("deno_core"); - } - - getRuntimeCrate() { - return this.getCrate("deno_runtime"); - } - - getBenchUtilCrate() { - return this.getCrate("deno_bench_util"); - } - - getExtCrates() { - const extPath = path.join(this.#repo.folderPath, "ext"); - return this.crates.filter((c) => c.manifestPath.startsWith(extPath)); - } - getCrate(name: string) { return this.#repo.getCrate(name); } diff --git a/tools/release/deps.ts b/tools/release/deps.ts index 5e249c1cf0..86f1db10f1 100644 --- a/tools/release/deps.ts +++ b/tools/release/deps.ts @@ -1,3 +1,3 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -export * from "https://raw.githubusercontent.com/denoland/automation/0.4.0/mod.ts"; +export * from "https://raw.githubusercontent.com/denoland/automation/0.5.0/mod.ts";