Elffuss BraidHub

kikocis/lancedb public

ci: enable java auto release (#1602)

Enable bump java pom.xml versions
Enable auto java release when detect stable github release
Changesetb4d5e491c2be3ba25462233ceaff04e735e44d3bbbd1714c5a45789e509dbcfd
AuthorLuQQiu <luqiujob@gmail.com> · 2024-09-19 10:51 -07:00
CommitterGitHub <noreply@github.com> · 2024-09-19 10:51 -07:00
Parentsb73be5923470

Browse the files at this changeset

7 files changed

modified .bumpversion.toml +28 −6
@@ -24,34 +24,56 @@
2424 message = "Bump version: {current_version} → {new_version}"
2525 commit_args = ""
2626
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+
2749 [tool.bumpversion.parts.pre_l]
28-values = ["beta", "final"]
2950 optional_value = "final"
51+values = ["beta", "final"]
3052
3153 [[tool.bumpversion.files]]
3254 filename = "node/package.json"
33-search = "\"version\": \"{current_version}\","
3455 replace = "\"version\": \"{new_version}\","
56+search = "\"version\": \"{current_version}\","
3557
3658 [[tool.bumpversion.files]]
3759 filename = "nodejs/package.json"
38-search = "\"version\": \"{current_version}\","
3960 replace = "\"version\": \"{new_version}\","
61+search = "\"version\": \"{current_version}\","
4062
4163 # nodejs binary packages
4264 [[tool.bumpversion.files]]
4365 glob = "nodejs/npm/*/package.json"
44-search = "\"version\": \"{current_version}\","
4566 replace = "\"version\": \"{new_version}\","
67+search = "\"version\": \"{current_version}\","
4668
4769 # Cargo files
4870 # ------------
4971 [[tool.bumpversion.files]]
5072 filename = "rust/ffi/node/Cargo.toml"
51-search = "\nversion = \"{current_version}\""
5273 replace = "\nversion = \"{new_version}\""
74+search = "\nversion = \"{current_version}\""
5375
5476 [[tool.bumpversion.files]]
5577 filename = "rust/lancedb/Cargo.toml"
56-search = "\nversion = \"{current_version}\""
5778 replace = "\nversion = \"{new_version}\""
79+search = "\nversion = \"{current_version}\""
modified .github/workflows/java-publish.yml +5 −0
@@ -94,11 +94,16 @@
9494 mkdir -p ./core/target/classes/nativelib/darwin-aarch64 ./core/target/classes/nativelib/linux-aarch64
9595 cp ../liblancedb_jni_darwin_aarch64.zip/liblancedb_jni.dylib ./core/target/classes/nativelib/darwin-aarch64/liblancedb_jni.dylib
9696 cp ../liblancedb_jni_linux_aarch64.zip/liblancedb_jni.so ./core/target/classes/nativelib/linux-aarch64/liblancedb_jni.so
97+ - name: Dry run
98+ if: github.event_name == 'pull_request'
99+ run: |
100+ mvn --batch-mode -DskipTests package
97101 - name: Set github
98102 run: |
99103 git config --global user.email "LanceDB Github Runner"
100104 git config --global user.name "dev+gha@lancedb.com"
101105 - name: Publish with Java 8
106+ if: github.event_name == 'release'
102107 run: |
103108 echo "use-agent" >> ~/.gnupg/gpg.conf
104109 echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
modified .github/workflows/make-release-commit.yml +1 −1
@@ -30,7 +30,7 @@
3030 default: true
3131 type: boolean
3232 other:
33- description: 'Make a Node/Rust release'
33+ description: 'Make a Node/Rust/Java release'
3434 required: true
3535 default: true
3636 type: boolean
modified java/core/lancedb-jni/Cargo.toml +1 −1
@@ -2,7 +2,7 @@
22 name = "lancedb-jni"
33 description = "JNI bindings for LanceDB"
44 # TODO modify lancedb/Cargo.toml for version and dependencies
5-version = "0.4.18"
5+version = "0.10.0"
66 edition.workspace = true
77 repository.workspace = true
88 readme.workspace = true
modified java/core/pom.xml +2 −2
@@ -8,7 +8,7 @@
88 <parent>
99 <groupId>com.lancedb</groupId>
1010 <artifactId>lancedb-parent</artifactId>
11- <version>0.0.3</version>
11+ <version>0.10.0</version>
1212 <relativePath>../pom.xml</relativePath>
1313 </parent>
1414
@@ -44,7 +44,7 @@
4444 <dependency>
4545 <groupId>org.junit.jupiter</groupId>
4646 <artifactId>junit-jupiter</artifactId>
47- <scope>test</scope>
47+ <scope>test</scope>
4848 </dependency>
4949 </dependencies>
5050
modified java/pom.xml +7 −5
@@ -6,7 +6,7 @@
66
77 <groupId>com.lancedb</groupId>
88 <artifactId>lancedb-parent</artifactId>
9- <version>0.0.3</version>
9+ <version>0.10.0</version>
1010 <packaging>pom</packaging>
1111
1212 <name>LanceDB Parent</name>
@@ -92,7 +92,7 @@
9292 </repository>
9393 </distributionManagement>
9494
95- <build>
95+ <build>
9696 <plugins>
9797 <plugin>
9898 <groupId>org.apache.maven.plugins</groupId>
@@ -167,7 +167,8 @@
167167 <version>3.2.5</version>
168168 <configuration>
169169 <argLine>--add-opens=java.base/java.nio=ALL-UNNAMED</argLine>
170- <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
170+ <forkNode
171+ implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
171172 <useSystemClassLoader>false</useSystemClassLoader>
172173 </configuration>
173174 </plugin>
@@ -183,7 +184,7 @@
183184 </pluginManagement>
184185 </build>
185186
186- <profiles>
187+ <profiles>
187188 <profile>
188189 <id>jdk8</id>
189190 <activation>
@@ -210,7 +211,8 @@
210211 <version>3.2.5</version>
211212 <configuration>
212213 <argLine>--add-opens=java.base/java.nio=ALL-UNNAMED</argLine>
213- <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
214+ <forkNode
215+ implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
214216 <useSystemClassLoader>false</useSystemClassLoader>
215217 </configuration>
216218 </plugin>
modified release_process.md +25 −22
@@ -1,11 +1,11 @@
11 # Release process
22
3-There are five total packages we release. Three are the `lancedb` packages
4-for Python, Rust, and Node.js. The other two are the legacy `vectordb`
5-packages for Rust and node.js.
6-
7-The Python package is versioned and released separately from the Rust and Node.js
8-ones. For Rust and Node.js, the release process is shared between `lancedb` and
3+There are five total packages we release. Four are the `lancedb` packages
4+for Python, Rust, Java, and Node.js. The other one is the legacy `vectordb`
5+package node.js.
6+
7+The Python package is versioned and released separately from the Rust, Java, and Node.js
8+ones. For Node.js the release process is shared between `lancedb` and
99 `vectordb` for now.
1010
1111 ## Preview releases
@@ -24,20 +24,23 @@
2424 The release process uses a handful of GitHub actions to automate the process.
2525
2626 ```text
27- ┌─────────────────────┐
28- │Create Release Commit│
29- └─┬───────────────────┘
30- │ ┌────────────┐ ┌──►Python GH Release
31- ├──►(tag) python-vX.Y.Z ───►│PyPI Publish├─┤
32- │ └────────────┘ └──►Python Wheels
33- │
34- │ ┌───────────┐
35- └──►(tag) vX.Y.Z ───┬──────►│NPM Publish├──┬──►Rust/Node GH Release
36- │ └───────────┘ │
37- │ └──►NPM Packages
38- │ ┌─────────────┐
39- └──────►│Cargo Publish├───►Cargo Release
40- └─────────────┘
27+ ┌─────────────────────┐
28+ │Create Release Commit│
29+ └─┬───────────────────┘
30+ │ ┌────────────┐ ┌──►Python GH Release
31+ ├──►(tag) python-vX.Y.Z ───►│PyPI Publish├─┤
32+ │ └────────────┘ └──►Python Wheels
33+ │
34+ │ ┌───────────┐
35+ └──►(tag) vX.Y.Z ───┬──────►│NPM Publish├──┬──►Rust/Node GH Release
36+ │ └───────────┘ │
37+ │ └──►NPM Packages
38+ │ ┌─────────────┐
39+ ├──────►│Cargo Publish├───►Cargo Release
40+ │ └─────────────┘
41+ │ ┌─────────────┐
42+ └──────►│Maven Publish├───►Java Maven Repo Release
43+ └─────────────┘
4144 ```
4245
4346 To start a release, trigger a `Create Release Commit` action from
@@ -56,10 +59,10 @@
5659 ## Breaking changes
5760
5861 We try to avoid breaking changes, but sometimes they are necessary. When there
59-are breaking changes, we will increment the minor version. (This is valid
62+are breaking changes, we will increment the minor version. (This is valid
6063 semantic versioning because we are still in `0.x` versions.)
6164
62-When a PR makes a breaking change, the PR author should mark the PR using the
65+When a PR makes a breaking change, the PR author should mark the PR using the
6366 conventional commit markers: either exclamation mark after the type
6467 (such as `feat!: change signature of func`) or have `BREAKING CHANGE` in the
6568 body of the PR. A CI job will add a `breaking-change` label to the PR, which is