Skip to content
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e501dcc
fix(java): downgrade Ubuntu to 20.04 for publishing Java artifacts
jackye1995 Apr 17, 2025
0a059ae
use docker build
jackye1995 Apr 26, 2025
4d4ab38
non interactive
jackye1995 Apr 26, 2025
178f597
add curl
jackye1995 Apr 26, 2025
baf355a
add cc
jackye1995 Apr 26, 2025
02e1073
use gcc10
jackye1995 Apr 26, 2025
cab4d7f
use 22.04 base
jackye1995 Apr 26, 2025
fb17cba
revert base to 24.04
jackye1995 Apr 26, 2025
aff737e
trigger release CI
jackye1995 Apr 26, 2025
2e392d5
on push
jackye1995 Apr 26, 2025
3dc4dc5
on pull request
jackye1995 Apr 26, 2025
d3f7021
trigger ci
jackye1995 Apr 26, 2025
94b08c7
trigger ci
jackye1995 Apr 26, 2025
5ea3725
fix ci
jackye1995 Apr 26, 2025
81fde1f
build using clang
jackye1995 Apr 26, 2025
9d48f07
use larger runner
jackye1995 Apr 26, 2025
c758dde
proto version
jackye1995 Apr 26, 2025
c83faa0
temporarily disable build flag optional
jackye1995 Apr 26, 2025
4c1deb6
upgrade protoc
jackye1995 Apr 26, 2025
6a05344
manual protoc
jackye1995 Apr 26, 2025
c90eb3a
unzip
jackye1995 Apr 26, 2025
b7ef91a
protoc version
jackye1995 Apr 26, 2025
51bba58
use protoc source
jackye1995 Apr 26, 2025
c5677c7
use 3.14.0
jackye1995 Apr 26, 2025
ac0f1a0
fix typo
jackye1995 Apr 26, 2025
4653db2
use 3.15
jackye1995 Apr 26, 2025
de6b43c
commit
jackye1995 Apr 27, 2025
456f45d
fix platform
jackye1995 Apr 27, 2025
f389d4d
use original timeout
jackye1995 Apr 27, 2025
30e249f
fix typo
jackye1995 Apr 27, 2025
ee569bc
install jdk8 separately
jackye1995 Apr 27, 2025
d7a9ad6
fix proto platform
jackye1995 Apr 27, 2025
a2274ba
escape quote
jackye1995 Apr 27, 2025
46ad110
add java home
jackye1995 Apr 27, 2025
15f2d37
try with debian 10
jackye1995 Apr 28, 2025
7dfd07a
add mirror
jackye1995 Apr 28, 2025
1e818a7
not use gcc10
jackye1995 Apr 28, 2025
7eae04d
update gcc10
jackye1995 Apr 28, 2025
e9a05a2
install maven
jackye1995 Apr 28, 2025
a2dc82a
manual java install
jackye1995 Apr 28, 2025
c2b125a
temp disable dep
jackye1995 Apr 28, 2025
635bd83
temp disable download
jackye1995 Apr 28, 2025
8bfde99
use jdk8 debian
jackye1995 Apr 28, 2025
78878f4
maven399
jackye1995 Apr 28, 2025
7727f5e
use jdk
jackye1995 Apr 28, 2025
92afb00
try run tests
jackye1995 Apr 28, 2025
e3720af
clean up before merge
jackye1995 Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
225 changes: 193 additions & 32 deletions .github/workflows/java-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,68 @@ jobs:
name: Build on Linux Arm64
runs-on: ubuntu-2404-8x-arm64
timeout-minutes: 60
defaults:
run:
working-directory: ./java
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "stable"
cache-workspaces: "src/rust"
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
rustflags: "-C debuginfo=1"
- name: Install dependencies
run: |
sudo apt -y -qq update
sudo apt install -y protobuf-compiler libssl-dev pkg-config
- name: Build release
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check glibc version outside docker
run: ldd --version
- name: Build and run in Ubuntu 20.04 container
run: |
cargo build --release
cp ../target/release/liblance_jni.so liblance_jni.so
docker run --platform linux/arm64 -v ${{ github.workspace }}:/workspace -w /workspace debian:10 bash -c "

set -ex
apt-get update

DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \
apt-transport-https \
ca-certificates \
curl \
gpg \
bash \
less \
openssl \
libssl-dev \
pkg-config \
libsqlite3-dev \
libsqlite3-0 \
libreadline-dev \
git \
cmake \
dh-autoreconf \
clang \
g++ \
libc++-dev \
libc++abi-dev \
libprotobuf-dev \
libncurses5-dev \
libncursesw5-dev \
libudev-dev \
libhidapi-dev \
zip \
unzip

# https://github.com/databendlabs/databend/issues/8035
PROTOC_ZIP=protoc-3.15.0-linux-aarch_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.0/\$PROTOC_ZIP
unzip -o \$PROTOC_ZIP -d /usr/local
rm -f \$PROTOC_ZIP
protoc --version

curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
source \$HOME/.cargo/env

cd java

# https://github.com/rustls/rustls/issues/1967
export CC=clang
export CXX=clang++
ldd --version

cargo build --release
cp ../target/release/liblance_jni.so liblance_jni.so
"
- uses: actions/upload-artifact@v4
with:
name: liblance_jni_linux_aarch64.zip
Expand Down Expand Up @@ -97,21 +137,142 @@ jobs:
mkdir -p ./core/target/classes/nativelib/darwin-aarch64 ./core/target/classes/nativelib/linux-aarch64
cp ../liblance_jni_darwin_aarch64.zip/liblance_jni.dylib ./core/target/classes/nativelib/darwin-aarch64/liblance_jni.dylib
cp ../liblance_jni_linux_aarch64.zip/liblance_jni.so ./core/target/classes/nativelib/linux-aarch64/liblance_jni.so
- name: Set github
run: |
git config --global user.email "Lance Github Runner"
git config --global user.name "dev+gha@lancedb.com"
- name: Dry run
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check glibc version outside docker
run: ldd --version
- name: Build and run in Ubuntu 20.04 container (Dry Run)
if: github.event_name == 'pull_request'
run: |
mvn --batch-mode -DskipTests -Drust.release.build=true package
- name: Publish with Java 8
docker run --platform linux/amd64 -v ${{ github.workspace }}:/workspace -w /workspace openjdk:8-jdk-buster bash -c "
set -ex
apt-get update

DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \
apt-transport-https \
ca-certificates \
curl \
gpg \
bash \
less \
openssl \
libssl-dev \
pkg-config \
libsqlite3-dev \
libsqlite3-0 \
libreadline-dev \
git \
cmake \
dh-autoreconf \
clang \
g++ \
libc++-dev \
libc++abi-dev \
libprotobuf-dev \
libncurses5-dev \
libncursesw5-dev \
libudev-dev \
libhidapi-dev \
zip \
unzip \

# manually install maven, apt will use java11
MAVEN_VERSION=3.9.6
curl -OL https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
tar -xzf apache-maven-3.9.9-bin.tar.gz
mv apache-maven-3.9.9 /opt/maven
ln -s /opt/maven/bin/mvn /usr/bin/mvn

# https://github.com/databendlabs/databend/issues/8035
PROTOC_ZIP=protoc-3.15.0-linux-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.0/\$PROTOC_ZIP
unzip -o \$PROTOC_ZIP -d /usr/local
rm -f \$PROTOC_ZIP
protoc --version

# set Github
git config --global user.email \"Lance Github Runner\"
git config --global user.name \"dev+gha@lancedb.com\"

curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
source \$HOME/.cargo/env

cd java

# https://github.com/rustls/rustls/issues/1967
export CC=clang
export CXX=clang++
ldd --version

mvn --batch-mode -DskipTests -Drust.release.build=true package
"
- name: Build and run in Ubuntu 20.04 container (Publish to Sonatype)
if: github.event_name == 'release'
run: |
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
export GPG_TTY=$(tty)
mvn --batch-mode -DskipTests -Drust.release.build=true -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy -P deploy-to-ossrh -P shade-jar
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
docker run --platform linux/amd64 -v ${{ github.workspace }}:/workspace -w /workspace openjdk:8-jdk-buster bash -c "
set -ex
apt-get update

DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \
apt-transport-https \
ca-certificates \
curl \
gpg \
bash \
less \
openssl \
libssl-dev \
pkg-config \
libsqlite3-dev \
libsqlite3-0 \
libreadline-dev \
git \
cmake \
dh-autoreconf \
clang \
g++ \
libc++-dev \
libc++abi-dev \
libprotobuf-dev \
libncurses5-dev \
libncursesw5-dev \
libudev-dev \
libhidapi-dev \
zip \
unzip

# manually install maven, apt will use java11
MAVEN_VERSION=3.9.6
curl -OL https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
tar -xzf apache-maven-3.9.9-bin.tar.gz
mv apache-maven-3.9.9 /opt/maven
ln -s /opt/maven/bin/mvn /usr/bin/mvn

# https://github.com/databendlabs/databend/issues/8035
PROTOC_ZIP=protoc-3.15.0-linux-x86_64.zip
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.0/\$PROTOC_ZIP
unzip -o \$PROTOC_ZIP -d /usr/local
rm -f \$PROTOC_ZIP
protoc --version

# set Github
git config --global user.email \"Lance Github Runner\"
git config --global user.name \"dev+gha@lancedb.com\"

curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
source \$HOME/.cargo/env

cd java

# https://github.com/rustls/rustls/issues/1967
export CC=clang
export CXX=clang++
ldd --version

export SONATYPE_USER=${{ secrets.SONATYPE_USER }}
export SONATYPE_TOKEN=${{ secrets.SONATYPE_TOKEN }}
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
export GPG_TTY=$(tty)
mvn --batch-mode -DskipTests -Drust.release.build=true -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy -P deploy-to-ossrh -P shade-jar
"
Loading