Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(cua-driver-rs): make Cargo.toml the source of truth for release bumps (#1907)

Francesco Bonaccidacde8147e6c
diff --git a/.github/workflows/release-bump-version.yml b/.github/workflows/release-bump-version.yml
index e550a254fc..059cc13ab1 100644
--- a/.github/workflows/release-bump-version.yml
+++ b/.github/workflows/release-bump-version.yml
@@ -200,6 +200,31 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
+ - name: Reconcile cua-driver-rs bump base with Cargo.toml (drift guard)
+ if: ${{ inputs.service == 'cua-driver-rs' }}
+ run: |
+ # Cargo.toml is the single source of truth for the cua-driver-rs
+ # version. bump2version keeps a duplicate current_version in
+ # .bumpversion.cfg, and that copy has silently drifted before and cut
+ # a release at the wrong version (binary reported a stale version,
+ # tag could downgrade). Reconcile the cfg to Cargo.toml here, before
+ # the dry-run tag-clean and the real bump both read it, so a bump can
+ # never start from a stale base again no matter what the committed
+ # cfg says.
+ cd "${{ steps.package.outputs.directory }}"
+ CARGO_VERSION=$(grep -m1 '^version[[:space:]]*=' Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')
+ CFG_VERSION=$(grep -m1 '^current_version[[:space:]]*=' .bumpversion.cfg | sed -E 's/.*=[[:space:]]*//')
+ if [ -z "$CARGO_VERSION" ]; then
+ echo "::error::could not read version from libs/cua-driver/rust/Cargo.toml"
+ exit 1
+ fi
+ if [ "$CARGO_VERSION" != "$CFG_VERSION" ]; then
+ echo "::warning::.bumpversion.cfg current_version ($CFG_VERSION) drifted from Cargo.toml ($CARGO_VERSION); reconciling to Cargo.toml before bump."
+ sed -i.bak -E "s/^current_version[[:space:]]*=.*/current_version = ${CARGO_VERSION}/" .bumpversion.cfg
+ rm -f .bumpversion.cfg.bak
+ fi
+ echo "cua-driver-rs bump base: $(grep -m1 '^current_version' .bumpversion.cfg)"
+
- name: Clean existing tags if present
run: |
# Function to clean a tag for a given package directory
diff --git a/libs/cua-driver/rust/.bumpversion.cfg b/libs/cua-driver/rust/.bumpversion.cfg
index b5af4a47e9..a886b8bfb9 100644
--- a/libs/cua-driver/rust/.bumpversion.cfg
+++ b/libs/cua-driver/rust/.bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 0.4.3
+current_version = 0.5.3
commit = True
tag = True
tag_name = cua-driver-rs-v{new_version}