cd javatester
mvn package
java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
- cd ..
android:
runs-on: ubuntu-latest
export PATH=`pwd`/clang+llvm-14.0.1-x86_64-apple-darwin/bin:$PATH
cd ldk-c-bindings
CC=clang ./genbindings.sh ../rust-lightning true
- cd ..
- - name: Fetch OpenJDK 16
- run: |
- wget -O openjdk-16.0.1_osx-x64_bin.tar.gz https://download.java.net/java/GA/jdk16.0.1/7147401fd7354114ac51ef3e1328291f/9/GPL/openjdk-16.0.1_osx-x64_bin.tar.gz
- if [ "$(shasum -a 256 openjdk-16.0.1_osx-x64_bin.tar.gz | awk '{ print $1 }')" != "6098f839954439d4916444757c542c1b8778a32461706812d41cc8bbefce7f2f" ]; then
- echo "Bad hash"
- exit 1
+ - name: Fetch OpenJDK 18
+ run: |
+ if [ "$(uname -m)" = "arm64" ]; then
+ wget -O openjdk-18.0.1.1_macos-aarch64_bin.tar.gz https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_macos-aarch64_bin.tar.gz
+ if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-aarch64_bin.tar.gz | awk '{ print $1 }')" != "29773ad68063bdad7fbaeb762cd873d3f243e86de380d3ac5335cdb929371fb5" ]; then
+ echo "Bad hash"
+ exit 1
+ fi
+ tar xvvf openjdk-18.0.1.1_macos-aarch64_bin.tar.gz
+ else
+ wget -O openjdk-18.0.1.1_macos-x64_bin.tar.gz https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_macos-x64_bin.tar.gz
+ if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-x64_bin.tar.gz | awk '{ print $1 }')" != "f02d17ec5a387555f8489abc352d973b6c10364409b597046025938e2266d72a" ]; then
+ echo "Bad hash"
+ exit 1
+ fi
+ tar xvvf openjdk-18.0.1.1_macos-x64_bin.tar.gz
fi
- tar xvvf openjdk-16.0.1_osx-x64_bin.tar.gz
- name: Checkout latest Linux binaries
run: |
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
- name: Build Java Release Bindings
run: |
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
- export JAVA_HOME=`pwd`/jdk-16.0.1.jdk/Contents/Home
+ export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export PATH=`pwd`/clang+llvm-14.0.1-x86_64-apple-darwin/bin:$PATH
./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
+
if [ "${{ matrix.platform }}" = "macos-11" ]; then
export CC="clang --target=aarch64-apple-darwin"
export LDK_TARGET=aarch64-apple-darwin
export LDK_TARGET_CPU=apple-a14
./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
cat src/main/resources/liblightningjni_MacOSX-aarch64.nativelib > /dev/null
+
fi
+
- name: Fetch Maven 3.8.4
run: |
# We don't bother using the upstream mirrors as they remove prior
export PATH=apache-maven-3.8.4/bin:$PATH
- name: Run Java Tests against built jar
run: |
- export JAVA_HOME=`pwd`/jdk-16.0.1.jdk/Contents/Home
+ export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
mvn -DskipTests=true package
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
cd javatester
mvn -q -B package
java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
- cd ..
- name: Check latest release libs are in git
run: |
if [ "${{ matrix.platform }}" = "macos-11" ]; then
run: |
if [ "${{ matrix.platform }}" != "macos-11" ]; then
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
- export JAVA_HOME=`pwd`/jdk-16.0.1.jdk/Contents/Home
+ export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
mvn clean
cd javatester
mvn -q -B package
java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
- cd ..
fi
fi
cp "$1/lightning-c-bindings/include/lightning.h" ./
-if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ]; then
+if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ] || [ "$(rustc --version --verbose | grep "host:")" = "host: aarch64-apple-darwin" ]; then
# OSX sed is for some reason not compatible with GNU sed
sed -i '' "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h
else
LDK_JAR_TARGET=true
;;
"aarch64-apple-darwin"*)
+ LDK_TARGET_CPU="apple-a14"
LDK_TARGET_SUFFIX="_MacOSX-aarch64"
LDK_JAR_TARGET=true
;;
LDK_TARGET_CPU="sandybridge"
fi
- if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ]; then
+ if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ] || [ "$(rustc --version --verbose | grep "host:")" = "host: aarch64-apple-darwin" ]; then
# OSX sed is for some reason not compatible with GNU sed
sed -i '' "s/^ <version>.*<\/version>/ <version>${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}<\/version>/g" pom.xml
else