Skip to content

Commit 6dc505c

Browse files
authored
build: Add xtask automation for binding version management (microsoft#491)
* build: Add xtask automation for binding version management Introduces a dedicated xtask crate that keeps language binding versions in sync with the core regorus crate, following the workflow pattern used by rust-analyzer, gitoxide, and ripgrep. Key features: - Git-based change detection: compares binding source files against a base ref (merge-base with origin/main by default) plus unstaged/ untracked files to identify which bindings have been modified - SemVer-aware bumping: binding edits trigger a minor version increment (e.g. 0.5.1 → 0.6.0) under pre-1.0 semantics, signaling potential breaking changes; clean bindings simply align to the root version - Multi-language support: updates Cargo manifests (Rust FFI, Java, Python, WASM, Ruby), Maven pom.xml (Java), Ruby version constants, and C# project files in a single pass - CI integration: --check mode fails fast when manifests are out of sync, ensuring pre-commit and release-plz workflows catch stale versions before merge Integration points: - release-plz.toml: runs cargo xtask bindings --base-ref origin/main after bumping the root crate, so binding versions are updated atomically during the release process - scripts/pre-commit: invokes cargo xtask bindings --check to block commits that would leave bindings out of sync - .cargo/config.toml: defines cargo xtask alias for convenience Documentation includes inline examples showing how version bumps behave when bindings are ahead/behind the root, and notes that the minor field acts as the major version under SemVer 0.y.z initial development phase. Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com> * build: refresh xtask tooling, workflows, and locks - cargo xtask bindings: keep the binding version-sync pipeline intact - cargo xtask update-deps: new helper to regenerate workspace/binding Cargo.lock files - workflows: auto-detect the Java jar version in CI and temporarily disable the Ruby workflow - lock files: refresh root + binding snapshots after the dependency sweep Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com> --------- Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
1 parent 091bbb2 commit 6dc505c

26 files changed

Lines changed: 1727 additions & 1313 deletions

File tree

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --package xtask --"

.github/workflows/test-java.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,19 @@ jobs:
2929
cargo clippy --all-targets --no-deps -- -Dwarnings
3030
cargo build --release --manifest-path bindings/java/Cargo.toml --locked
3131
32+
- name: Capture binding version
33+
run: |
34+
version=$(cargo metadata --manifest-path bindings/java/Cargo.toml --format-version 1 \
35+
| jq -r '.packages[] | select(.name == "regorus-java") | .version')
36+
echo "REGORUS_JAVA_VERSION=$version" >> "$GITHUB_ENV"
37+
3238
- name: Build jar
3339
run: mvn package
3440
working-directory: ./bindings/java
3541

3642
- name: Test jar
3743
run: |
38-
javac -cp target/regorus-java-0.2.2.jar Test.java
39-
java -Djava.library.path=target/release -cp target/regorus-java-0.2.2.jar:. Test
44+
jar="regorus-java-${REGORUS_JAVA_VERSION}.jar"
45+
javac -cp "target/${jar}" Test.java
46+
java -Djava.library.path=target/release -cp "target/${jar}:." Test
4047
working-directory: ./bindings/java

.github/workflows/test-ruby.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
jobs:
1010
test:
11+
if: false # temporarily disabled
1112
runs-on: ubuntu-latest
1213
steps:
1314
- name: Checkout repository

0 commit comments

Comments
 (0)