From b4654d09fd203aa1c097edc5074db16f9813b3a8 Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Tue, 24 Mar 2026 14:48:13 -0600 Subject: [PATCH] fix: version sync workspace --- .changeset/fix-version-sync-workspace.md | 7 +++++++ Cargo.lock | 4 ++-- crates/google-workspace-cli/Cargo.toml | 2 +- crates/google-workspace/Cargo.toml | 2 +- scripts/version-sync.sh | 23 ++++++++++++++--------- 5 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 .changeset/fix-version-sync-workspace.md diff --git a/.changeset/fix-version-sync-workspace.md b/.changeset/fix-version-sync-workspace.md new file mode 100644 index 000000000..e9033a1ba --- /dev/null +++ b/.changeset/fix-version-sync-workspace.md @@ -0,0 +1,7 @@ +--- +"@googleworkspace/cli": patch +--- + +Fix version-sync script and bump CLI crate version to 0.21.0 + +The `version-sync.sh` script was updating the root `Cargo.toml` which no longer has a `[package]` section after the workspace refactor. Updated to target `crates/google-workspace-cli/Cargo.toml`. Also syncs the CLI crate version to 0.21.0 to match `package.json`. diff --git a/Cargo.lock b/Cargo.lock index 86d8cc80b..cec6cde8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -896,7 +896,7 @@ dependencies = [ [[package]] name = "google-workspace" -version = "0.1.0" +version = "0.21.0" dependencies = [ "anyhow", "percent-encoding", @@ -912,7 +912,7 @@ dependencies = [ [[package]] name = "google-workspace-cli" -version = "0.20.1" +version = "0.21.0" dependencies = [ "aes-gcm", "anyhow", diff --git a/crates/google-workspace-cli/Cargo.toml b/crates/google-workspace-cli/Cargo.toml index 2dc53aa0b..cf3191f28 100644 --- a/crates/google-workspace-cli/Cargo.toml +++ b/crates/google-workspace-cli/Cargo.toml @@ -14,7 +14,7 @@ [package] name = "google-workspace-cli" -version = "0.20.1" +version = "0.21.0" edition = "2021" description = "Google Workspace CLI — dynamic command surface from Discovery Service" license = "Apache-2.0" diff --git a/crates/google-workspace/Cargo.toml b/crates/google-workspace/Cargo.toml index a8f71c50b..62db7025d 100644 --- a/crates/google-workspace/Cargo.toml +++ b/crates/google-workspace/Cargo.toml @@ -14,7 +14,7 @@ [package] name = "google-workspace" -version = "0.1.0" +version = "0.21.0" edition = "2021" description = "Google Workspace API client — Discovery Document types, service registry, and HTTP utilities" license = "Apache-2.0" diff --git a/scripts/version-sync.sh b/scripts/version-sync.sh index 41064bc12..d64f74e65 100755 --- a/scripts/version-sync.sh +++ b/scripts/version-sync.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -# Syncs the version from package.json into Cargo.toml, updates Cargo.lock, and regenerates skills. +# Syncs the version from package.json into all workspace Cargo.toml files, +# updates Cargo.lock, and regenerates skills. # Used by changesets/action as a custom version command. set -euo pipefail @@ -9,14 +10,17 @@ pnpm changeset version # Read the new version from package.json VERSION=$(node -p "require('./package.json').version") -# Update Cargo.toml version field +# Update version in all workspace crate Cargo.toml files # Uses awk to only change the version under [package], not other sections -awk -v ver="$VERSION" ' - /^\[package\]/ { in_pkg=1 } - /^\[/ && !/^\[package\]/ { in_pkg=0 } - in_pkg && /^version = / { $0 = "version = \"" ver "\"" } - { print } -' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml +for cargo_toml in crates/*/Cargo.toml; do + tmp=$(mktemp) + awk -v ver="$VERSION" ' + /^\[package\]/ { in_pkg=1 } + /^\[/ && !/^\[package\]/ { in_pkg=0 } + in_pkg && /^version = / { $0 = "version = \"" ver "\"" } + { print } + ' "$cargo_toml" > "$tmp" && mv "$tmp" "$cargo_toml" +done # Update Cargo.lock to match cargo generate-lockfile @@ -30,4 +34,5 @@ fi cargo run -- generate-skills --output-dir skills # Stage the changed files so changesets/action commits them -git add Cargo.toml Cargo.lock flake.nix flake.lock skills/ +git add crates/*/Cargo.toml Cargo.lock flake.nix flake.lock skills/ +