From fa73df9fc34f72e3e920ce7fd2a9f7aa6aa8c647 Mon Sep 17 00:00:00 2001 From: bennyhodl Date: Mon, 1 Jun 2026 11:39:49 -0400 Subject: [PATCH] ci: read version correctly in Cargo.toml --- release.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release.js b/release.js index d8b05d9a..581d1f44 100644 --- a/release.js +++ b/release.js @@ -77,14 +77,17 @@ function getRepoInfo() { return repoInfo; } -// Read the current workspace version. All crates share one version, so any -// member works; ddk is the canonical one. +// Read the current workspace version. All crates inherit it via +// `version.workspace = true`, so the canonical source is the root +// Cargo.toml's [workspace.package] section. function currentVersion() { const m = fs - .readFileSync("ddk/Cargo.toml", "utf8") - .match(/^version = "(.*)"$/m); + .readFileSync("Cargo.toml", "utf8") + .match(/^\[workspace\.package\][\s\S]*?^version = "(.*)"$/m); if (!m) { - console.error("❌ Could not read current version from ddk/Cargo.toml"); + console.error( + "❌ Could not read current version from [workspace.package] in Cargo.toml" + ); process.exit(1); } return m[1];