Build Linux java-tree-sitter native (.so) #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 python3 git openjdk-17-jdk-headless | |
| - name: Clone java-tree-sitter (latest, with submodules for cpp only) | |
| run: | | |
| git clone --depth 1 https://github.com/seart-group/java-tree-sitter.git java-tree-sitter | |
| cd java-tree-sitter | |
| # Only init the submodules we actually need | |
| git submodule update --init --depth 1 tree-sitter tree-sitter-cpp | |
| - name: Build native library (C++ grammar only, glibc) | |
| run: | | |
| cd java-tree-sitter | |
| python3 build.py --verbose tree-sitter-cpp | |
| ls -lh libjava-tree-sitter.so | |
| file libjava-tree-sitter.so | |
| ldd libjava-tree-sitter.so | |
| - name: Copy to libs/linux-x64/ | |
| run: | | |
| mkdir -p libs/linux-x64 | |
| cp java-tree-sitter/libjava-tree-sitter.so libs/linux-x64/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-ts-native | |
| path: libs/linux-x64/libjava-tree-sitter.so | |
| retention-days: 90 |