| 1 | [tool.bumpversion] |
| 2 | current_version = "0.11.1-beta.1" |
| 3 | parse = """(?x) |
| 4 | (?P<major>0|[1-9]\\d*)\\. |
| 5 | (?P<minor>0|[1-9]\\d*)\\. |
| 6 | (?P<patch>0|[1-9]\\d*) |
| 7 | (?:-(?P<pre_l>[a-zA-Z-]+)\\.(?P<pre_n>0|[1-9]\\d*))? |
| 8 | """ |
| 9 | serialize = [ |
| 10 | "{major}.{minor}.{patch}-{pre_l}.{pre_n}", |
| 11 | "{major}.{minor}.{patch}", |
| 12 | ] |
| 13 | search = "{current_version}" |
| 14 | replace = "{new_version}" |
| 15 | regex = false |
| 16 | ignore_missing_version = false |
| 17 | ignore_missing_files = false |
| 18 | tag = true |
| 19 | sign_tags = false |
| 20 | tag_name = "v{new_version}" |
| 21 | tag_message = "Bump version: {current_version} → {new_version}" |
| 22 | allow_dirty = true |
| 23 | commit = true |
| 24 | message = "Bump version: {current_version} → {new_version}" |
| 25 | commit_args = "" |
| 26 | |
| 27 | # Java maven files |
| 28 | pre_commit_hooks = [ |
| 29 | """ |
| 30 | NEW_VERSION="${BVHOOK_NEW_MAJOR}.${BVHOOK_NEW_MINOR}.${BVHOOK_NEW_PATCH}" |
| 31 | if [ ! -z "$BVHOOK_NEW_PRE_L" ] && [ ! -z "$BVHOOK_NEW_PRE_N" ]; then |
| 32 | NEW_VERSION="${NEW_VERSION}-${BVHOOK_NEW_PRE_L}.${BVHOOK_NEW_PRE_N}" |
| 33 | fi |
| 34 | echo "Constructed new version: $NEW_VERSION" |
| 35 | cd java && mvn versions:set -DnewVersion=$NEW_VERSION && mvn versions:commit |
| 36 | |
| 37 | # Check for any modified but unstaged pom.xml files |
| 38 | MODIFIED_POMS=$(git ls-files -m | grep pom.xml) |
| 39 | if [ ! -z "$MODIFIED_POMS" ]; then |
| 40 | echo "The following pom.xml files were modified but not staged. Adding them now:" |
| 41 | echo "$MODIFIED_POMS" | while read -r file; do |
| 42 | git add "$file" |
| 43 | echo "Added: $file" |
| 44 | done |
| 45 | fi |
| 46 | """, |
| 47 | ] |
| 48 | |
| 49 | [tool.bumpversion.parts.pre_l] |
| 50 | optional_value = "final" |
| 51 | values = ["beta", "final"] |
| 52 | |
| 53 | [[tool.bumpversion.files]] |
| 54 | filename = "node/package.json" |
| 55 | replace = "\"version\": \"{new_version}\"," |
| 56 | search = "\"version\": \"{current_version}\"," |
| 57 | |
| 58 | [[tool.bumpversion.files]] |
| 59 | filename = "nodejs/package.json" |
| 60 | replace = "\"version\": \"{new_version}\"," |
| 61 | search = "\"version\": \"{current_version}\"," |
| 62 | |
| 63 | # nodejs binary packages |
| 64 | [[tool.bumpversion.files]] |
| 65 | glob = "nodejs/npm/*/package.json" |
| 66 | replace = "\"version\": \"{new_version}\"," |
| 67 | search = "\"version\": \"{current_version}\"," |
| 68 | |
| 69 | # vectodb node binary packages |
| 70 | [[tool.bumpversion.files]] |
| 71 | glob = "node/package.json" |
| 72 | replace = "\"@lancedb/vectordb-darwin-arm64\": \"{new_version}\"" |
| 73 | search = "\"@lancedb/vectordb-darwin-arm64\": \"{current_version}\"" |
| 74 | |
| 75 | [[tool.bumpversion.files]] |
| 76 | glob = "node/package.json" |
| 77 | replace = "\"@lancedb/vectordb-darwin-x64\": \"{new_version}\"" |
| 78 | search = "\"@lancedb/vectordb-darwin-x64\": \"{current_version}\"" |
| 79 | |
| 80 | [[tool.bumpversion.files]] |
| 81 | glob = "node/package.json" |
| 82 | replace = "\"@lancedb/vectordb-linux-arm64-gnu\": \"{new_version}\"" |
| 83 | search = "\"@lancedb/vectordb-linux-arm64-gnu\": \"{current_version}\"" |
| 84 | |
| 85 | [[tool.bumpversion.files]] |
| 86 | glob = "node/package.json" |
| 87 | replace = "\"@lancedb/vectordb-linux-x64-gnu\": \"{new_version}\"" |
| 88 | search = "\"@lancedb/vectordb-linux-x64-gnu\": \"{current_version}\"" |
| 89 | |
| 90 | [[tool.bumpversion.files]] |
| 91 | glob = "node/package.json" |
| 92 | replace = "\"@lancedb/vectordb-win32-x64-msvc\": \"{new_version}\"" |
| 93 | search = "\"@lancedb/vectordb-win32-x64-msvc\": \"{current_version}\"" |
| 94 | |
| 95 | # Cargo files |
| 96 | # ------------ |
| 97 | [[tool.bumpversion.files]] |
| 98 | filename = "rust/ffi/node/Cargo.toml" |
| 99 | replace = "\nversion = \"{new_version}\"" |
| 100 | search = "\nversion = \"{current_version}\"" |
| 101 | |
| 102 | [[tool.bumpversion.files]] |
| 103 | filename = "rust/lancedb/Cargo.toml" |
| 104 | replace = "\nversion = \"{new_version}\"" |
| 105 | search = "\nversion = \"{current_version}\"" |
| 106 | |
| 107 | [[tool.bumpversion.files]] |
| 108 | filename = "nodejs/Cargo.toml" |
| 109 | replace = "\nversion = \"{new_version}\"" |
| 110 | search = "\nversion = \"{current_version}\"" |