Skip to content

Commit 50e89aa

Browse files
authored
chore: cleanup java workflow names and remove redundant java test workflow (#116)
* remove test-java bindings * rename java workflow * rename * use compile_all_targets_java.sh
1 parent 7bb8a38 commit 50e89aa

4 files changed

+35
-98
lines changed

.github/scripts/compile_all_targets_java.sh

+32-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,38 @@
22

33
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
5-
6-
# Compile dynamic libraries for all relevant targets
7-
# and place them in the `./bindings/java/java_code/src/main/resources` directory
8-
95
OUT_DIR="$PROJECT_ROOT/bindings/java/java_code/src/main/resources"
106
LIB_TYPE="dynamic"
117
LIB_NAME="java_eth_kzg"
12-
$PROJECT_ROOT/scripts/compile_to_native.sh Darwin arm64 $LIB_NAME $LIB_TYPE $OUT_DIR
13-
$PROJECT_ROOT/scripts/compile_to_native.sh Darwin x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
14-
$PROJECT_ROOT/scripts/compile_to_native.sh Windows x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
15-
$PROJECT_ROOT/scripts/compile_to_native.sh Linux x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
16-
$PROJECT_ROOT/scripts/compile_to_native.sh Linux arm64 $LIB_NAME $LIB_TYPE $OUT_DIR
8+
9+
# Check if a target is provided
10+
if [ $# -eq 0 ]; then
11+
echo "Please provide a target architecture."
12+
echo "Supported targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-pc-windows-gnu"
13+
exit 1
14+
fi
15+
16+
TARGET=$1
17+
18+
case $TARGET in
19+
"x86_64-unknown-linux-gnu")
20+
$PROJECT_ROOT/scripts/compile_to_native.sh Linux x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
21+
;;
22+
"aarch64-unknown-linux-gnu")
23+
$PROJECT_ROOT/scripts/compile_to_native.sh Linux arm64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
24+
;;
25+
"aarch64-apple-darwin")
26+
$PROJECT_ROOT/scripts/compile_to_native.sh Darwin arm64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
27+
;;
28+
"x86_64-apple-darwin")
29+
$PROJECT_ROOT/scripts/compile_to_native.sh Darwin x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
30+
;;
31+
"x86_64-pc-windows-gnu")
32+
$PROJECT_ROOT/scripts/compile_to_native.sh Windows x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
33+
;;
34+
*)
35+
echo "Unsupported target: $TARGET"
36+
echo "Supported targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-pc-windows-gnu"
37+
exit 1
38+
;;
39+
esac

.github/scripts/compile_all_targets_java_new.sh

-39
This file was deleted.

.github/workflows/release-java-bindings.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java Cross-platform Build and Test
1+
name: Java Bindings
22

33
on:
44
push:
@@ -59,8 +59,8 @@ jobs:
5959
run: cargo binstall --no-confirm cargo-zigbuild
6060
- name: Run compile script
6161
run: |
62-
chmod +x .github/scripts/compile_all_targets_java_new.sh
63-
.github/scripts/compile_all_targets_java_new.sh ${{ matrix.target }}
62+
chmod +x .github/scripts/compile_all_targets_java.sh
63+
.github/scripts/compile_all_targets_java.sh ${{ matrix.target }}
6464
shell: bash
6565
- name: Upload dynamic libs
6666
uses: actions/upload-artifact@v4

.github/workflows/test-java-bindings.yml

-47
This file was deleted.

0 commit comments

Comments
 (0)