From 9e58109ec22e24d9c32dd63c817ef9b703551af0 Mon Sep 17 00:00:00 2001 From: Jose Llamas Date: Mon, 31 Aug 2026 09:22:31 -0700 Subject: [PATCH] Add build-linux-ts-native workflow --- .github/workflows/build-linux-ts-native.yml | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build-linux-ts-native.yml diff --git a/.github/workflows/build-linux-ts-native.yml b/.github/workflows/build-linux-ts-native.yml new file mode 100644 index 0000000..f72a1b2 --- /dev/null +++ b/.github/workflows/build-linux-ts-native.yml @@ -0,0 +1,47 @@ +name: Build Linux java-tree-sitter native (.so) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake git openjdk-17-jdk-headless + + - name: Clone java-tree-sitter 1.9.1 + run: | + git clone --depth 1 --branch 1.9.1 \ + https://github.com/seart-group/java-tree-sitter.git java-tree-sitter + + - name: Build native library + run: | + cd java-tree-sitter + # The native CMake target produces libjava-tree-sitter.so + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS="-O2" \ + -DJTREESITTER_BUILD_SHARED_LIBS=ON + cmake --build build --target java-tree-sitter -- -j$(nproc) + # Find the .so wherever CMake placed it + find build -name "libjava-tree-sitter.so" + + - name: Copy to libs/linux-x64/ + run: | + mkdir -p libs/linux-x64 + find java-tree-sitter/build -name "libjava-tree-sitter.so" \ + -exec cp {} libs/linux-x64/ \; + echo "Built:" + file libs/linux-x64/libjava-tree-sitter.so + ldd libs/linux-x64/libjava-tree-sitter.so + + - uses: actions/upload-artifact@v4 + with: + name: linux-ts-native + path: libs/linux-x64/libjava-tree-sitter.so + retention-days: 90