This is an automated email from the ASF dual-hosted git repository.
JingsongLi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-full-text.git
The following commit(s) were added to refs/heads/main by this push:
new 06876f4 [Java] Add CI for publishing Java snapshot Jar (#8)
06876f4 is described below
commit 06876f45fa10792274b9ea8f3f79ba5796f2e6dc
Author: yuzelin <[email protected]>
AuthorDate: Mon Jul 6 13:44:41 2026 +0800
[Java] Add CI for publishing Java snapshot Jar (#8)
---
.github/workflows/publish_snapshot.yml | 198 +++++++++++++++++++++++++++++++++
deploysettings.xml | 37 ++++++
java/pom.xml | 51 +++++++++
tools/update_branch_version.sh | 69 ++++++++++++
4 files changed, 355 insertions(+)
diff --git a/.github/workflows/publish_snapshot.yml
b/.github/workflows/publish_snapshot.yml
new file mode 100644
index 0000000..3a6c509
--- /dev/null
+++ b/.github/workflows/publish_snapshot.yml
@@ -0,0 +1,198 @@
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+# either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+################################################################################
+
+name: Publish Snapshot
+
+on:
+ schedule:
+ # At the end of every day
+ - cron: '0 0 * * *'
+ workflow_dispatch:
+
+env:
+ JDK_VERSION: 8
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event_name }}-${{
github.event.number || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ build-native:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-latest
+ target: x86_64-unknown-linux-gnu
+ os_name: linux
+ arch: x86_64
+ lib_name: libpaimon_ftindex_jni.so
+ - os: ubuntu-24.04-arm
+ target: aarch64-unknown-linux-gnu
+ os_name: linux
+ arch: aarch64
+ lib_name: libpaimon_ftindex_jni.so
+ - os: macos-latest
+ target: aarch64-apple-darwin
+ os_name: macos
+ arch: aarch64
+ lib_name: libpaimon_ftindex_jni.dylib
+ - os: windows-latest
+ target: x86_64-pc-windows-msvc
+ os_name: windows
+ arch: x86_64
+ lib_name: paimon_ftindex_jni.dll
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Setup Rust toolchain
+ run: |
+ rustup update stable
+ rustup default stable
+
+ - name: Cache Rust dependencies
+ uses: actions/cache@v5
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ target
+ key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{
hashFiles('**/Cargo.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-${{ matrix.target }}-cargo-
+
+ - name: Setup Python
+ if: matrix.os_name == 'linux'
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ - name: Setup Linux zigbuild
+ if: matrix.os_name == 'linux'
+ run: pip install cargo-zigbuild
+
+ - name: Build Linux JNI library
+ if: matrix.os_name == 'linux'
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ rustup target add "${{ matrix.target }}"
+ unset ZSTD_SYS_USE_PKG_CONFIG
+
+ cargo zigbuild --release -p paimon-ftindex-jni --target "${{
matrix.target }}.2.17"
+
+ artifact="target/${{ matrix.target }}/release/${{ matrix.lib_name }}"
+ test -f "$artifact"
+
+ version_info="$(readelf --version-info "$artifact")"
+ max_glibc="$(
+ printf '%s\n' "$version_info" \
+ | grep -Eo 'GLIBC_[0-9][0-9.]*' \
+ | sort -Vu \
+ | tail -n1 \
+ || true
+ )"
+ echo "Maximum required GLIBC version: ${max_glibc:-none}"
+
+ if [[ -n "$max_glibc" ]]; then
+ allowed_glibc="GLIBC_2.17"
+ highest_glibc="$(printf '%s\n%s\n' "$allowed_glibc" "$max_glibc" |
sort -Vu | tail -n1)"
+ if [[ "$highest_glibc" != "$allowed_glibc" ]]; then
+ echo "Linux GNU artifact requires $max_glibc, expected <=
$allowed_glibc" >&2
+ exit 1
+ fi
+ fi
+
+ - name: Build JNI library
+ if: matrix.os_name != 'linux'
+ run: |
+ rustup target add "${{ matrix.target }}"
+ cargo build --release -p paimon-ftindex-jni --target "${{
matrix.target }}"
+
+ - name: Upload native library
+ uses: actions/upload-artifact@v5
+ with:
+ name: native-${{ matrix.os_name }}-${{ matrix.arch }}
+ path: target/${{ matrix.target }}/release/${{ matrix.lib_name }}
+
+ publish-snapshot:
+ if: github.repository == 'apache/paimon-full-text'
+ runs-on: ubuntu-latest
+ needs: [build-native]
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Download linux x86_64 native library
+ uses: actions/download-artifact@v5
+ with:
+ name: native-linux-x86_64
+ path: java/src/main/resources/native/linux/x86_64
+
+ - name: Download linux aarch64 native library
+ uses: actions/download-artifact@v5
+ with:
+ name: native-linux-aarch64
+ path: java/src/main/resources/native/linux/aarch64
+
+ - name: Download macOS aarch64 native library
+ uses: actions/download-artifact@v5
+ with:
+ name: native-macos-aarch64
+ path: java/src/main/resources/native/macos/aarch64
+
+ - name: Download windows x86_64 native library
+ uses: actions/download-artifact@v5
+ with:
+ name: native-windows-x86_64
+ path: java/src/main/resources/native/windows/x86_64
+
+ - name: Verify native libraries
+ run: find java/src/main/resources/native -type f | sort
+
+ - name: Set up JDK ${{ env.JDK_VERSION }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ env.JDK_VERSION }}
+ distribution: 'temurin'
+
+ - name: Cache local Maven repository
+ uses: actions/cache@v5
+ with:
+ path: ~/.m2/repository
+ key: snapshot-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ snapshot-maven-
+
+ - name: Publish snapshot
+ env:
+ ASF_USERNAME: ${{ secrets.NEXUS_USER }}
+ ASF_PASSWORD: ${{ secrets.NEXUS_PW }}
+ MAVEN_OPTS: -Xmx4096m
+ working-directory: java
+ run: |
+ tmp_settings="tmp-settings.xml"
+ echo "<settings><servers><server>" > $tmp_settings
+ echo
"<id>apache.snapshots.https</id><username>$ASF_USERNAME</username>" >>
$tmp_settings
+ echo "<password>$ASF_PASSWORD</password>" >> $tmp_settings
+ echo "</server></servers></settings>" >> $tmp_settings
+
+ mvn --settings $tmp_settings clean deploy -Dgpg.skip -Drat.skip
-DskipTests
+
+ rm $tmp_settings
diff --git a/deploysettings.xml b/deploysettings.xml
new file mode 100644
index 0000000..6026958
--- /dev/null
+++ b/deploysettings.xml
@@ -0,0 +1,37 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+
+-->
+
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
+ http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <servers>
+ <server>
+ <id>apache.snapshots.https</id>
+ <username>${sonatype_user}</username>
+ <password>${sonatype_pw}</password>
+ </server>
+ <server>
+ <id>apache.releases.https</id>
+ <username>${sonatype_user}</username>
+ <password>${sonatype_pw}</password>
+ </server>
+ </servers>
+</settings>
diff --git a/java/pom.xml b/java/pom.xml
index 0354201..e569e4b 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -4,17 +4,68 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>23</version>
+ </parent>
+
<groupId>org.apache.paimon</groupId>
<artifactId>paimon-full-text-index</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
+ <name>Apache Paimon Full Text Index Java</name>
+ <description>Full-text index for Java (backed by Rust via
JNI)</description>
+ <url>https://paimon.apache.org</url>
+ <inceptionYear>2026</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <scm>
+ <url>https://github.com/apache/paimon-full-text</url>
+ <connection>[email protected]:apache/paimon-full-text.git</connection>
+
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/paimon-full-text.git</developerConnection>
+ </scm>
+
+ <developers>
+ <developer>
+ <name>Apache Paimon Contributors</name>
+ <email>[email protected]</email>
+ <organization>Apache Software Foundation</organization>
+ <organizationUrl>https://www.apache.org</organizationUrl>
+ </developer>
+ </developers>
+
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- Used by maven-remote-resources-plugin when generating
META-INF/NOTICE. -->
+
<project.build.outputTimestamp>2026-01-01T00:00:00Z</project.build.outputTimestamp>
</properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.13.0</version>
+ <configuration>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>junit</groupId>
diff --git a/tools/update_branch_version.sh b/tools/update_branch_version.sh
new file mode 100755
index 0000000..03ec8a8
--- /dev/null
+++ b/tools/update_branch_version.sh
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+MVN=${MVN:-mvn}
+
+# fail immediately
+set -o errexit
+set -o nounset
+# print command before executing
+set -o xtrace
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+ echo "You have to call the script from the tools/ dir"
+ exit 1
+fi
+
+###########################
+
+OLD_VERSION=${OLD_VERSION}
+NEW_VERSION=${NEW_VERSION}
+
+
+if [ -z "${OLD_VERSION}" ]; then
+ echo "OLD_VERSION is unset"
+ exit 1
+fi
+
+if [ -z "${NEW_VERSION}" ]; then
+ echo "NEW_VERSION is unset"
+ exit 1
+fi
+
+cd ..
+
+# For Cargo.toml and pyproject.toml, strip any -SNAPSHOT suffix (not valid in
those ecosystems)
+NEW_VERSION_CLEAN=$(echo "$NEW_VERSION" | sed 's/-SNAPSHOT//')
+
+#change version in all pom files (match both exact and -SNAPSHOT suffix)
+find . -name 'pom.xml' -type f -exec perl -pi -e
's#<version>'$OLD_VERSION'(-SNAPSHOT)?</version>#<version>'$NEW_VERSION'</version>#'
{} \;
+
+#change version in Cargo.toml files
+find . -name 'Cargo.toml' -not -path '*/target/*' -type f -exec perl -pi -e
's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION_CLEAN'"#' {} \;
+
+#change version in pyproject.toml
+perl -pi -e 's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION_CLEAN'"#'
python/pyproject.toml
+
+git commit -am "Update version to $NEW_VERSION"
+
+echo "Don't forget to push the change."