mv liblightningjni_debug_Linux-amd64.so liblightningjni.so
export ASAN_OPTIONS=detect_leaks=0
LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so LD_LIBRARY_PATH=. mvn test
- - name: Detect current git version
- run: |
- # We assume the top commit is just a bindings update commit, so we
- # check out the previous commit to use as the commit we git describe.
- # If the top commit is a merge commit, we need to get the last merge
- # head and assume the latest bindings are built against its parent.
- COMMIT_PARENTS=$(git show -s --pretty=format:%P HEAD)
- if [ "${#COMMIT_PARENTS}" = 40 ]; then
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD^1)"
- else
- MERGE_HEAD=$(git show --pretty=format:%P HEAD | ( for last in $(cat /dev/stdin); do true; done; echo $last ))
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag $MERGE_HEAD^1)"
- fi
- echo "Using $LDK_GARBAGECOLLECTED_GIT_OVERRIDE as git version"
- echo "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" > .git_ver
- name: Checkout latest MacOS binaries
run: |
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
git clone --depth 1 https://git.bitcoin.ninja/ldk-java-bins
mkdir -p src/main/resources/
cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_MacOSX-"* src/main/resources/
- name: Build Java/TS Release Bindings
run: |
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" false false
- name: Build deterministic release jar
run: ./build-release-jar.sh
git diff --exit-code
- name: Check latest library and jars are in bins repo
run: |
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
rm "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"*.jar
rm "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_Linux*.nativelib
cp src/main/resources/liblightningjni_Linux-amd64.nativelib "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
git clone https://github.com/lightningdevkit/ldk-c-bindings
cd ldk-c-bindings
git checkout 0.0.101
- - name: Detect current git version
- run: |
- # We assume the top commit is just a bindings update commit, so we
- # check out the previous commit to use as the commit we git describe.
- # If the top commit is a merge commit, we need to get the last merge
- # head and assume the latest bindings are built against its parent.
- COMMIT_PARENTS=$(git show -s --pretty=format:%P HEAD)
- if [ "${#COMMIT_PARENTS}" = 40 ]; then
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD^1)"
- else
- MERGE_HEAD=$(git show --pretty=format:%P HEAD | ( for last in $(cat /dev/stdin); do true; done; echo $last ))
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag $MERGE_HEAD^1)"
- fi
- echo "Using $LDK_GARBAGECOLLECTED_GIT_OVERRIDE as git version"
- echo "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" > .git_ver
- name: Checkout Android AAR binaries and artifacts
run: git clone --depth 1 https://git.bitcoin.ninja/ldk-java-bins
- name: Build Android aar
run: |
. $HOME/.cargo/env
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" ./
export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64"
export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
./android-build.sh ./rust-lightning ./ldk-c-bindings/ ./ldk-java-bins/android-artifacts
- name: Check latest library and jars are in bins repo
run: |
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
rm "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/LDK-release.aar"
cp LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
cd ldk-java-bins
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: Detect current git version
- run: |
- # We assume the top commit is just a bindings update commit, so we
- # check out the previous commit to use as the commit we git describe.
- # If the top commit is a merge commit, we need to get the last merge
- # head and assume the latest bindings are built against its parent.
- COMMIT_PARENTS=$(git show -s --pretty=format:%P HEAD)
- if [ "${#COMMIT_PARENTS}" = 40 ]; then
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD^1)"
- else
- MERGE_HEAD=$(git show --pretty=format:%P HEAD | ( for last in $(cat /dev/stdin); do true; done; echo $last ))
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag $MERGE_HEAD^1)"
- fi
- echo "Using $LDK_GARBAGECOLLECTED_GIT_OVERRIDE as git version"
- echo "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" > .git_ver
- name: Checkout latest Linux binaries
run: |
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
git clone --depth 1 https://git.bitcoin.ninja/ldk-java-bins
mkdir -p src/main/resources/
cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_Linux-"* src/main/resources/
- name: Build Java/TS Release Bindings
run: |
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
# genbindings.sh always fails as there is no wasm32-wasi library
# available, so instead we check that the expected JNI library
# is created.
- name: Run Java Tests against built jar
run: |
mvn -DskipTests=true package
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ 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
cd javatester
- name: Check latest release libs are in git
run: |
if [ "${{ matrix.platform }}" = "macos-11" ]; then
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
rm "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib
cp src/main/resources/liblightningjni_MacOSX-*.nativelib "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"
cd ldk-java-bins
- name: Run Java Tests against release bins
run: |
if [ "${{ matrix.platform }}" != "macos-11" ]; then
- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(cat .git_ver)"
+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
mvn clean
mvn -DskipTests=true package