76a9e7a0cc
Automation / Format (push) Waiting to run
Automation / File Labeler (push) Waiting to run
Automation / Gemini Review (push) Waiting to run
Automation / Gemini Reviewed (push) Waiting to run
CI / Detect Changes (push) Waiting to run
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Nix (push) Blocked by required conditions
CI / Lint (push) Blocked by required conditions
CI / Cargo Deny (push) Blocked by required conditions
CI / Verify Skills (push) Blocked by required conditions
CI / Lint Skills (push) Blocked by required conditions
CI / Build (Linux x86_64) (push) Blocked by required conditions
CI / Build (macos-latest, aarch64-apple-darwin) (push) Blocked by required conditions
CI / Build (macos-latest, x86_64-apple-darwin) (push) Blocked by required conditions
CI / Build (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Blocked by required conditions
CI / Build (windows-latest, x86_64-pc-windows-msvc) (push) Blocked by required conditions
CI / API Smoketest (push) Blocked by required conditions
Coverage / Coverage (push) Waiting to run
Policy / Policy Check (push) Waiting to run
Release (Changeset) / Release (push) Waiting to run
Publish OpenClaw Skills / publish (push) Has been cancelled
Audit / Security Audit (push) Has been cancelled
50 lines
1.7 KiB
Bash
Executable File
50 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# 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
|
|
|
|
# Run the standard changeset version command first
|
|
pnpm changeset version
|
|
|
|
# Read the new version from package.json
|
|
VERSION=$(node -p "require('./package.json').version")
|
|
|
|
# Update version in all workspace crate Cargo.toml files
|
|
# Uses awk to only change the version under [package], not other sections
|
|
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 inter-crate dependency versions (e.g. google-workspace = { version = "X.Y.Z", path = "..." })
|
|
sed -i.bak -E "s/(google-workspace = \{ version = \")[^\"]+/\1${VERSION}/" crates/google-workspace-cli/Cargo.toml
|
|
rm -f crates/google-workspace-cli/Cargo.toml.bak
|
|
|
|
# Update npm installer package.json version
|
|
node -e "
|
|
const pkg = require('./npm/package.json');
|
|
pkg.version = '${VERSION}';
|
|
require('fs').writeFileSync('./npm/package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
"
|
|
|
|
# Update Cargo.lock to match
|
|
cargo generate-lockfile
|
|
|
|
# Update flake.lock if nix is available
|
|
if command -v nix > /dev/null 2>&1; then
|
|
nix flake lock --update-input nixpkgs
|
|
fi
|
|
|
|
# Regenerate skills so metadata.version tracks the CLI version
|
|
cargo run -- generate-skills --output-dir skills
|
|
|
|
# Stage the changed files so changesets/action commits them
|
|
git add crates/*/Cargo.toml Cargo.lock flake.nix flake.lock skills/ npm/package.json
|
|
|