]> git.bitcoin.ninja Git - ldk-java/commitdiff
Fix Java path setting in OSX builds
authorMatt Corallo <git@bluematt.me>
Tue, 21 Dec 2021 02:02:57 +0000 (02:02 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Dec 2021 04:29:40 +0000 (04:29 +0000)
.github/workflows/build.yml

index 512a1623d8683baef54fba92a95b854a2d61321f..f1f72c68c270221d770c4613a4c66850ae81edc4 100644 (file)
@@ -258,8 +258,6 @@ jobs:
             exit 1
           fi
           tar xvvf openjdk-16.0.1_osx-x64_bin.tar.gz
-          export JAVA_HOME=`pwd`/jdk-16.0.1.jdk/Contents/Home
-          export PATH=$JAVA_HOME/bin:$PATH
       - name: Checkout latest Linux binaries
         run: |
           export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
@@ -277,6 +275,8 @@ jobs:
       - name: Build Java/TS Release Bindings
         run: |
           export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
+          export JAVA_HOME=`pwd`/jdk-16.0.1.jdk/Contents/Home
+          export PATH=$JAVA_HOME/bin:$PATH
           # genbindings.sh always fails as there is no wasm32-wasi library
           # available, so instead we check that the expected JNI library
           # is created.
@@ -304,7 +304,9 @@ jobs:
           export PATH=apache-maven-3.8.4/bin:$PATH
       - name: Run Java Tests against built jar
         run: |
-          mvn -q -B -DskipTests=true package
+          export JAVA_HOME=`pwd`/jdk-16.0.1.jdk/Contents/Home
+          export PATH=$JAVA_HOME/bin:$PATH
+          mvn -DskipTests=true package
           export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
           JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
           mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
@@ -324,6 +326,8 @@ jobs:
         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 PATH=$JAVA_HOME/bin:$PATH
             cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
             mvn clean
             mvn -q -B -DskipTests=true package