-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (43 loc) · 1.68 KB
/
Copy pathbuild-linux-ts-native.yml
File metadata and controls
51 lines (43 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 @ 1.9.1
run: |
git clone --depth 1 --branch v1.9.1 https://github.com/seart-group/java-tree-sitter.git java-tree-sitter
- name: Init top-level grammar submodules (no nested)
run: |
cd java-tree-sitter
git submodule update --init --depth 1 --jobs 8
- name: Build native library (all grammars, glibc)
run: |
cd java-tree-sitter
python3 build.py --verbose
ls -lh libjava-tree-sitter.so
file libjava-tree-sitter.so
ldd libjava-tree-sitter.so
- name: Patch java-tree-sitter-1.9.1.jar with glibc .so
run: |
# Download jar from Maven Central (it's not committed to the repo)
JAR="java-tree-sitter-1.9.1.jar"
echo "Downloading $JAR from Maven Central…"
curl -fsSL "https://repo1.maven.org/maven2/ch/usi/si/seart/java-tree-sitter/1.9.1/$JAR" -o "$JAR"
# Replace the bundled musl .so with our glibc-compiled one
zip -j "$JAR" java-tree-sitter/libjava-tree-sitter.so
echo "Patched $JAR:"
unzip -l "$JAR" | grep "\.so\|\.dylib"
- uses: actions/upload-artifact@v4
with:
name: linux-ts-native
path: |
java-tree-sitter/libjava-tree-sitter.so
java-tree-sitter-1.9.1.jar
retention-days: 90