diff --git a/Cargo.lock b/Cargo.lock index f21e3e91f0..dc3560333f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3723,7 +3723,7 @@ dependencies = [ [[package]] name = "light-client" -version = "0.20.0" +version = "0.21.0" dependencies = [ "anchor-lang", "async-trait", @@ -3781,7 +3781,7 @@ dependencies = [ [[package]] name = "light-compressed-account" -version = "0.10.0" +version = "0.10.1" dependencies = [ "anchor-lang", "ark-bn254 0.5.0", @@ -3917,7 +3917,7 @@ dependencies = [ [[package]] name = "light-event" -version = "0.20.0" +version = "0.21.0" dependencies = [ "borsh 0.10.4", "light-compressed-account", @@ -4112,7 +4112,7 @@ dependencies = [ [[package]] name = "light-program-test" -version = "0.20.0" +version = "0.21.0" dependencies = [ "account-compression", "anchor-lang", @@ -4456,7 +4456,7 @@ dependencies = [ [[package]] name = "light-token-client" -version = "0.20.0" +version = "0.21.0" dependencies = [ "borsh 0.10.4", "light-client", diff --git a/Cargo.toml b/Cargo.toml index 3408df31af..92aaed7821 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -200,8 +200,8 @@ light-hash-set = { version = "4.0.0", path = "program-libs/hash-set" } light-indexed-merkle-tree = { version = "5.0.0", path = "program-libs/indexed-merkle-tree" } light-concurrent-merkle-tree = { version = "5.0.0", path = "program-libs/concurrent-merkle-tree" } light-sparse-merkle-tree = { version = "0.3.0", path = "sparse-merkle-tree" } -light-client = { path = "sdk-libs/client", version = "0.20.0" } -light-event = { path = "sdk-libs/event", version = "0.20.0" } +light-client = { path = "sdk-libs/client", version = "0.21.0" } +light-event = { path = "sdk-libs/event", version = "0.21.0" } light-hasher = { path = "program-libs/hasher", version = "5.0.0", default-features = false } light-macros = { path = "program-libs/macros", version = "2.2.0" } light-merkle-tree-reference = { path = "program-tests/merkle-tree", version = "4.0.0" } @@ -213,7 +213,7 @@ light-sdk = { path = "sdk-libs/sdk", version = "0.20.0" } light-sdk-pinocchio = { path = "sdk-libs/sdk-pinocchio", version = "0.20.0" } light-sdk-macros = { path = "sdk-libs/macros", version = "0.20.0" } light-sdk-types = { path = "sdk-libs/sdk-types", version = "0.20.0", default-features = false } -light-compressed-account = { path = "program-libs/compressed-account", version = "0.10.0", default-features = false } +light-compressed-account = { path = "program-libs/compressed-account", version = "0.10.1", default-features = false } light-compressible = { path = "program-libs/compressible", version = "0.5.0", default-features = false } light-token-interface = { path = "program-libs/token-interface", version = "0.4.0" } light-account-checks = { path = "program-libs/account-checks", version = "0.8.0", default-features = false } @@ -233,7 +233,7 @@ light-token-types = { path = "sdk-libs/token-types", version = "0.20.0" } light-token = { path = "sdk-libs/token-sdk", version = "0.20.0" } light-token-pinocchio = { path = "sdk-libs/token-pinocchio", version = "0.20.0" } light-compressed-token-sdk = { path = "sdk-libs/compressed-token-sdk", version = "0.20.0" } -light-token-client = { path = "sdk-libs/token-client", version = "0.20.0" } +light-token-client = { path = "sdk-libs/token-client", version = "0.21.0" } light-system-program-anchor = { path = "anchor-programs/system", version = "2.0.0", features = [ "cpi", ] } @@ -244,7 +244,7 @@ light-registry = { path = "programs/registry", version = "2.0.0", features = [ create-address-test-program = { path = "program-tests/create-address-test-program", version = "1.0.0", features = [ "cpi", ] } -light-program-test = { path = "sdk-libs/program-test", version = "0.20.0" } +light-program-test = { path = "sdk-libs/program-test", version = "0.21.0" } light-instruction-decoder = { path = "sdk-libs/instruction-decoder", version = "0.20.0" } light-instruction-decoder-derive = { path = "sdk-libs/instruction-decoder-derive", version = "0.2.0" } light-batched-merkle-tree = { path = "program-libs/batched-merkle-tree", version = "0.10.0" } diff --git a/program-libs/compressed-account/Cargo.toml b/program-libs/compressed-account/Cargo.toml index bb18cc5684..2ad55fe899 100644 --- a/program-libs/compressed-account/Cargo.toml +++ b/program-libs/compressed-account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-compressed-account" -version = "0.10.0" +version = "0.10.1" description = "Compressed account struct and common utility functions used in Light Protocol." readme = "README.md" repository = "https://github.com/Lightprotocol/light-protocol" diff --git a/scripts/release/check-dependents.sh b/scripts/release/check-dependents.sh index 9c23a67fe7..bc56e08916 100755 --- a/scripts/release/check-dependents.sh +++ b/scripts/release/check-dependents.sh @@ -2,20 +2,56 @@ set -euo pipefail # Check that all dependents of released packages are also being released -# Usage: ./scripts/release/check-dependents.sh -# Arguments: -# packages: Space-separated list of package names being released -# Exits with 0 if all dependents are included, 1 if missing dependents +# Usage: ./scripts/release/check-dependents.sh [--base-ref ] +# Patch version bumps are semver-compatible and skip the dependents check. + +BASE_REF="origin/main" +if [ "${1:-}" = "--base-ref" ]; then + BASE_REF="$2" + shift 2 +fi if [ $# -lt 1 ]; then - echo "Usage: $0 [package2] ..." >&2 + echo "Usage: $0 [--base-ref ] [package2] ..." >&2 exit 1 fi PACKAGES=("$@") +# Scan directories +SCAN_DIRS="program-libs sdk-libs prover/client sparse-merkle-tree" + +# Check if version bump is patch-only (0.x.y -> 0.x.z or 1.x.y -> 1.x.z) +is_patch_only() { + local old_ver="$1" new_ver="$2" + local old_major old_minor new_major new_minor + IFS='.' read -r old_major old_minor _ <<< "$old_ver" + IFS='.' read -r new_major new_minor _ <<< "$new_ver" + [ "$old_major" = "$new_major" ] && { [ "$old_major" != "0" ] || [ "$old_minor" = "$new_minor" ]; } +} + +# Filter to packages with breaking changes only +BREAKING_PACKAGES=() +for pkg in "${PACKAGES[@]}"; do + cargo_toml=$(find $SCAN_DIRS -name "Cargo.toml" -exec grep -l "^name = \"$pkg\"" {} \; 2>/dev/null | head -1) + if [ -n "$cargo_toml" ]; then + versions=$(git diff "$BASE_REF" -- "$cargo_toml" 2>/dev/null | grep -E '^\+version|^-version' | grep -v '+++\|---' || true) + old_ver=$(echo "$versions" | grep '^-version' | head -1 | awk -F'"' '{print $2}') + new_ver=$(echo "$versions" | grep '^\+version' | head -1 | awk -F'"' '{print $2}') + if [ -n "$old_ver" ] && [ -n "$new_ver" ] && is_patch_only "$old_ver" "$new_ver"; then + continue + fi + fi + BREAKING_PACKAGES+=("$pkg") +done + +if [ ${#BREAKING_PACKAGES[@]} -eq 0 ]; then + echo "All changes are patch-only - dependents check skipped" + exit 0 +fi + # Packages to exclude from dependent checks (e.g., not published to crates.io) -EXCLUDED_PACKAGES="light-token-client" +EXCLUDED_PACKAGES="" # Scan all lib directories SCAN_DIRS="program-libs sdk-libs prover/client sparse-merkle-tree" @@ -58,8 +94,8 @@ for cargo_toml in $CARGO_FILES; do fi done -# Check each released package for missing dependents -for pkg in "${PACKAGES[@]}"; do +# Check each package with breaking changes for missing dependents +for pkg in "${BREAKING_PACKAGES[@]}"; do # Find all packages that depend on this package if [ -s "$DEPS_FILE" ]; then dependents=$(grep ":${pkg}$" "$DEPS_FILE" 2>/dev/null | cut -d: -f1 | sort -u || true) diff --git a/sdk-libs/client/Cargo.toml b/sdk-libs/client/Cargo.toml index da58dc7c8f..81f0878cb8 100644 --- a/sdk-libs/client/Cargo.toml +++ b/sdk-libs/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-client" -version = "0.20.0" +version = "0.21.0" edition = "2021" license = "Apache-2.0" repository = "https://github.com/lightprotocol/light-protocol" diff --git a/sdk-libs/event/Cargo.toml b/sdk-libs/event/Cargo.toml index 76156bdbf6..ab6a3256bb 100644 --- a/sdk-libs/event/Cargo.toml +++ b/sdk-libs/event/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-event" -version = "0.20.0" +version = "0.21.0" description = "Event types and utilities for Light Protocol" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0" diff --git a/sdk-libs/program-test/Cargo.toml b/sdk-libs/program-test/Cargo.toml index 4adec6f6c3..a05b4856ed 100644 --- a/sdk-libs/program-test/Cargo.toml +++ b/sdk-libs/program-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-program-test" -version = "0.20.0" +version = "0.21.0" description = "A fast local test environment for Solana programs using compressed accounts and tokens." license = "MIT" edition = "2021" diff --git a/sdk-libs/token-client/Cargo.toml b/sdk-libs/token-client/Cargo.toml index d1964d5a48..e47e83e5b5 100644 --- a/sdk-libs/token-client/Cargo.toml +++ b/sdk-libs/token-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "light-token-client" -version = "0.20.0" +version = "0.21.0" description = "Client library for Light Tokens" repository = "https://github.com/Lightprotocol/light-protocol" license = "Apache-2.0"