1 name: Continuous Integration Checks
3 on: [push, pull_request]
8 # Ubuntu's version of clang doesn't support....anything that should work.
9 # Ubuntu is an utter trash OS and should generally never be used for anything.
10 # We also require at least rustc 1.51 (ie https://github.com/rust-lang/rust/pull/79998),
11 # so we use debian testing
12 container: debian:bookworm
16 - name: Install build utilities and test that clang can build for wasm
19 apt-get -y dist-upgrade
20 apt-get -y install cargo libstd-rust-dev-wasm32 lld git g++ clang curl node-typescript npm python3 wasi-libc
21 echo "int main() {}" > genbindings_wasm_test_file.c
22 clang -nostdlib -o /dev/null --target=wasm32-wasi -Wl,--no-entry genbindings_wasm_test_file.c
23 rm genbindings_wasm_test_file.c
24 - name: Checkout source code
25 uses: actions/checkout@v2
28 - name: Install cbindgen
30 git clone https://github.com/eqrion/cbindgen
33 cargo update -p indexmap --precise "1.6.2" --verbose
34 cargo install --locked --path .
35 - name: Checkout Rust-Lightning and LDK-C-Bindings git
37 git config --global safe.directory '*'
38 git config --global user.email "ldk-ci@example.com"
39 git config --global user.name "LDK CI"
40 # Note this is a different endpoint, as we need one non-upstream commit!
41 git clone https://git.bitcoin.ninja/rust-lightning
43 git checkout origin/2023-02-0.0.114-java-bindings
45 git clone https://github.com/lightningdevkit/ldk-c-bindings
48 - name: Rebuild C bindings without STD
51 git config --global safe.directory "*"
52 ./genbindings.sh ../rust-lightning false
53 - name: Build and Test TS Debug Bindings for Node
55 # We need FinalizationRegistry and top-level await support, which requires node 14.6/8,
56 # however Debian ships with Node 12
57 # Thus, we install the binary nodejs from nodejs.org and test with that.
58 curl https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz > nodejs.tar.xz
59 tar xvvf nodejs.tar.xz
60 export PATH=$(pwd)/$(echo node-*/bin):$PATH
61 ./genbindings.sh ./ldk-c-bindings/ wasm true false
62 - name: Build and Test TS Release Bindings for Node
64 export PATH=$(pwd)/$(echo node-*/bin):$PATH
65 ./genbindings.sh ./ldk-c-bindings/ wasm false false
66 - name: Install Playwright for Web Tests
68 export HOME=/root/ # Github actions is apparently broken
69 export PATH=$(pwd)/$(echo node-*/bin):$PATH
70 # npx playwright install-deps is broken so we do it manually, see https://github.com/microsoft/playwright/issues/11165
71 apt-get install -y --no-install-recommends fonts-liberation libenchant-2-2 libicu72 libjpeg62-turbo libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 xvfb fonts-noto-color-emoji fonts-unifont libfontconfig libfreetype6 xfonts-scalable fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf ffmpeg libcairo-gobject2 libdbus-glib-1-2 libfontconfig1 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxt6 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libepoxy0 libevdev2 libgl1 libgles2 libgstreamer-gl1.0-0 libgstreamer1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libnotify4 libopenjp2-7 libopus0 libpng16-16 libsecret-1-0 libsoup2.4-1 libwayland-client0 libwayland-egl1 libwayland-server0 libwebp7 libwebpdemux2 libwoff1 libxkbcommon0 libxml2 libxslt1.1
72 mkdir -p $HOME/.cache/ms-playwright # `playwright install` is too dumb to create this for us
75 npx playwright install
76 - name: Build and Test TS Debug Bindings for Web
78 export HOME=/root/ # Github actions is apparently broken
79 export PATH=$(pwd)/$(echo node-*/bin):$PATH
80 git config --global safe.directory "*"
81 ./genbindings.sh ./ldk-c-bindings/ wasm true true
83 rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_debug.wasm ./liblightningjs.wasm
84 python3 -m http.server &
88 - name: Build and Test TS Release Bindings for Web
90 export HOME=/root/ # Github actions is apparently broken
91 export PATH=$(pwd)/$(echo node-*/bin):$PATH
92 ./genbindings.sh ./ldk-c-bindings/ wasm false true
94 rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_release.wasm ./liblightningjs.wasm
95 python3 -m http.server &
99 - name: Check latest TS files are in git
101 git checkout ts/package.json
102 git checkout node-net/package.json
106 runs-on: ubuntu-latest
107 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
108 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
109 container: debian:bullseye
113 - name: Install native Rust toolchain, Valgrind, and build utilitis
116 apt-get -y dist-upgrade
117 apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
118 - name: Checkout source code
119 uses: actions/checkout@v2
122 - name: Install cbindgen
124 git config --global safe.directory '*'
125 git clone https://github.com/eqrion/cbindgen
128 cargo update -p indexmap --precise "1.6.2" --verbose
129 cargo install --locked --path .
130 - name: Checkout Rust-Lightning and LDK-C-Bindings git
132 git config --global user.email "ldk-ci@example.com"
133 git config --global user.name "LDK CI"
134 # Note this is a different endpoint, as we need one non-upstream commit!
135 git clone https://git.bitcoin.ninja/rust-lightning
137 git checkout origin/2023-02-0.0.114-java-bindings
139 git clone https://github.com/lightningdevkit/ldk-c-bindings
142 - name: Rebuild C bindings, and check the sample app builds + links
145 ./genbindings.sh ../rust-lightning true
146 - name: Build Java Debug Bindings
147 run: ./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" true false
148 - name: Run Java Tests against Debug Bindings
150 mv liblightningjni_debug_Linux-amd64.so liblightningjni.so
151 export ASAN_OPTIONS=detect_leaks=0
152 LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so LD_LIBRARY_PATH=. mvn test
153 - name: Build Java Release Bindings
155 ./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
156 - name: Check latest headers are in git
162 runs-on: ubuntu-latest
163 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
164 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
165 container: debian:bullseye
169 - name: Install native Rust toolchain, Valgrind, and build utilitis
172 apt-get -y dist-upgrade
173 apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
174 - name: Checkout source code
175 uses: actions/checkout@v2
178 - name: Install cbindgen
180 git config --global safe.directory '*'
181 git clone https://github.com/eqrion/cbindgen
184 cargo update -p indexmap --precise "1.6.2" --verbose
185 cargo install --locked --path .
186 - name: Checkout Rust-Lightning and LDK-C-Bindings git
188 git config --global user.email "ldk-ci@example.com"
189 git config --global user.name "LDK CI"
190 # Note this is a different endpoint, as we need one non-upstream commit!
191 git clone https://git.bitcoin.ninja/rust-lightning
193 git checkout origin/2023-02-0.0.114-java-bindings
195 git clone https://github.com/lightningdevkit/ldk-c-bindings
198 - name: Rebuild C bindings, and check the sample app builds + links
201 ./genbindings.sh ../rust-lightning true
202 - name: Checkout latest MacOS binaries
204 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
205 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
206 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
207 SNAPSHOT_LINK="$(curl "https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE};hb=refs/heads/main" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
208 curl -o bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
209 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
210 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
211 tar xvvf ../../bins-snapshot.tgz
212 mv ldk-java-bins-*/* ./
213 rm -r ldk-java-bins-*
215 mkdir -p src/main/resources/
216 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_MacOSX-"* src/main/resources/
217 rm src/main/resources/liblightningjni_MacOSX-*-leaktracking.nativelib
218 - name: Build Java Release Bindings
220 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
221 ./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
222 - name: Build deterministic release jar
223 run: ./build-release-jar.sh
224 - name: Check latest library and jars are in bins repo
226 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
227 mkdir ldk-java-bins/new/
228 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_Mac*.nativelib ldk-java-bins/new/
229 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"LDK-release.aar ldk-java-bins/new/
230 # ldk-java-leaktracking is only for debug purposes and we don't bother with determinism
231 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"ldk-java-leaktracking.jar ldk-java-bins/new/
232 cp src/main/resources/liblightningjni_Linux-amd64.nativelib ldk-java-bins/new/
233 cp ldk-java-sources.jar ldk-java-bins/new/
234 cp ldk-java.jar ldk-java-bins/new/
235 cp ldk-java-classes.jar ldk-java-bins/new/
236 cp ldk-java-javadoc.jar ldk-java-bins/new/
238 if ! diff -r "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/" new/; then
239 apt-get -y install diffoscope
240 diffoscope new/ldk-java-sources.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-sources.jar" || echo
241 diffoscope new/ldk-java-javadoc.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-javadoc.jar" || echo
242 diffoscope new/ldk-java-classes.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" || echo
243 diffoscope new/ldk-java.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java.jar" || echo
246 - name: Run Java Tests against built release jar
248 mvn install:install-file -Dfile=ldk-java.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
251 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
254 runs-on: ubuntu-latest
255 # Frankly, I'm not really sure why debian and ubuntu differ in the results here, they really shouldn't
256 container: debian:bullseye
260 - name: Install rust targets
263 apt-get -y dist-upgrade
264 apt-get -y install git g++ clang faketime zip unzip curl openjdk-11-jdk
265 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
269 rustup target add armv7-linux-androideabi
270 rustup target add aarch64-linux-android
271 rustup target add i686-linux-android
272 rustup target add x86_64-linux-android
273 - name: Checkout source code
274 uses: actions/checkout@v2
277 - name: Install android NDK compilers
279 git config --global safe.directory '*'
280 curl https://dl.google.com/android/repository/android-ndk-r22b-linux-x86_64.zip > android-ndk-r22b-linux-x86_64.zip
281 if [ "$(sha256sum android-ndk-r22b-linux-x86_64.zip | awk '{ print $1 }')" != "ac3a0421e76f71dd330d0cd55f9d99b9ac864c4c034fc67e0d671d022d4e806b" ]; then
285 unzip android-ndk-r22b-linux-x86_64.zip
286 - name: Install cbindgen
289 cargo install cbindgen
290 - name: Checkout Rust-Lightning and LDK-C-Bindings git
292 git config --global user.email "ldk-ci@example.com"
293 git config --global user.name "LDK CI"
294 # Note this is a different endpoint, as we need one non-upstream commit!
295 git clone https://git.bitcoin.ninja/rust-lightning
297 git checkout origin/2023-02-0.0.114-java-bindings
299 git clone https://github.com/lightningdevkit/ldk-c-bindings
302 - name: Checkout Android AAR binaries and artifacts
304 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
305 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
306 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
307 RELEASE_PAGE="https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE};hb=refs/heads/main"
308 SNAPSHOT_LINK="$(curl "$RELEASE_PAGE" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
309 curl -o bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
311 ANDROID_PAGE="https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=android-artifacts;hb=refs/heads/main"
312 SNAPSHOT_LINK="$(curl "$ANDROID_PAGE" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
313 curl -o android-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
315 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
316 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
317 tar xvvf ../../bins-snapshot.tgz
318 mv ldk-java-bins-*/* ./
319 rm -r ldk-java-bins-*
321 mkdir -p ../android-artifacts
322 cd ../android-artifacts
323 tar xvvf ../../android-snapshot.tgz
324 mv ldk-java-bins-*/* ./
325 rm -r ldk-java-bins-*
326 - name: Build Android aar
329 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
330 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" ./
331 export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64"
332 export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
333 ./android-build.sh ./rust-lightning ./ldk-c-bindings/ ./ldk-java-bins/android-artifacts
334 - name: Check latest library and jars are in bins repo
336 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
337 if ! diff LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"LDK-release.aar; then
338 apt-get -y install diffoscope
339 diffoscope LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/LDK-release.aar"
347 - platform: macos-10.15
350 runs-on: ${{ matrix.platform }}
352 - name: Install other Rust platforms
353 run: rustup target install aarch64-apple-darwin
354 - name: Checkout source code
355 uses: actions/checkout@v2
358 - name: Fetch upstream LLVM/clang snapshot
360 git config --global safe.directory '*'
361 wget -O clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz
362 if [ "$(shasum -a 256 clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz | awk '{ print $1 }')" != "d16b6d536364c5bec6583d12dd7e6cf841b9f508c4430d9ee886726bd9983f1c" ]; then
366 - name: Unpack upstream LLVM+clang and use it by default
368 tar xvvf clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz
369 - name: Install cbindgen
370 run: cargo install cbindgen
371 - name: Checkout Rust-Lightning and LDK-C-Bindings git
373 git config --global user.email "ldk-ci@example.com"
374 git config --global user.name "LDK CI"
375 # Note this is a different endpoint, as we need one non-upstream commit!
376 git clone https://git.bitcoin.ninja/rust-lightning
378 git checkout origin/2023-02-0.0.114-java-bindings
380 git clone https://github.com/lightningdevkit/ldk-c-bindings
383 - name: Rebuild C bindings with upstream clang, and check the sample app builds + links
385 export PATH=`pwd`/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin:$PATH
387 CC=clang ./genbindings.sh ../rust-lightning true
388 - name: Fetch OpenJDK 18
390 if [ "$(uname -m)" = "arm64" ]; then
391 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
392 if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-aarch64_bin.tar.gz | awk '{ print $1 }')" != "29773ad68063bdad7fbaeb762cd873d3f243e86de380d3ac5335cdb929371fb5" ]; then
396 tar xvvf openjdk-18.0.1.1_macos-aarch64_bin.tar.gz
398 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
399 if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-x64_bin.tar.gz | awk '{ print $1 }')" != "f02d17ec5a387555f8489abc352d973b6c10364409b597046025938e2266d72a" ]; then
403 tar xvvf openjdk-18.0.1.1_macos-x64_bin.tar.gz
405 - name: Checkout latest Linux binaries
407 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
408 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
409 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
410 SNAPSHOT_LINK="$(wget -O /dev/stdout "https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE};hb=refs/heads/main" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
411 wget -O bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
412 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
413 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
414 tar xvvf ../../bins-snapshot.tgz
415 mv ldk-java-bins-*/* ./
417 mkdir -p src/main/resources/
418 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_Linux-"* src/main/resources/
419 - name: Build Java Release Bindings
421 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
422 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
423 export PATH=$JAVA_HOME/bin:$PATH
424 export PATH=`pwd`/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin:$PATH
425 ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
427 if [ "${{ matrix.platform }}" = "macos-11" ]; then
428 export CC="clang --target=aarch64-apple-darwin"
429 export LDK_TARGET=aarch64-apple-darwin
430 export LDK_TARGET_CPU=apple-a14
431 ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
432 cat src/main/resources/liblightningjni_MacOSX-aarch64.nativelib > /dev/null
436 - name: Fetch Maven 3.8.4
438 # We don't bother using the upstream mirrors as they remove prior
439 # releases aggressively, causing spurious CI failures when we don't
440 # care about the version used.
441 wget -O apache-maven-3.8.4-bin.tar.gz https://bitcoin.ninja/apache-maven-3.8.4-bin.tar.gz
442 if [ "$(shasum -a 256 apache-maven-3.8.4-bin.tar.gz | awk '{ print $1 }')" != "2cdc9c519427bb20fdc25bef5a9063b790e4abd930e7b14b4e9f4863d6f9f13c" ]; then
446 tar xvvf apache-maven-3.8.4-bin.tar.gz
447 export PATH=apache-maven-3.8.4/bin:$PATH
448 - name: Run Java Tests against built jar
450 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
451 export PATH=$JAVA_HOME/bin:$PATH
452 mvn -DskipTests=true package
453 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
454 JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
455 mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
458 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
459 - name: Check latest release libs are in git
461 if [ "${{ matrix.platform }}" = "macos-11" ]; then
462 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
463 # Sadly, OSX binaries are not currently deterministic, more debugging is needed.
464 diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-x86_64.nativelib src/main/resources/liblightningjni_MacOSX-x86_64.nativelib || echo
465 diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-aarch64.nativelib src/main/resources/liblightningjni_MacOSX-aarch64.nativelib || echo
467 - name: Upload CI x86_64 build for analysis
468 if: matrix.platform == 'macos-11'
469 uses: actions/upload-artifact@v3.0.0
471 name: liblightningjni_MacOSX-x86_64.nativelib.ci-build
472 path: src/main/resources/liblightningjni_MacOSX-x86_64.nativelib
473 - name: Upload CI aarch64 build for analysis
474 if: matrix.platform == 'macos-11'
475 uses: actions/upload-artifact@v3.0.0
477 name: liblightningjni_MacOSX-aarch64.nativelib.ci-build
478 path: src/main/resources/liblightningjni_MacOSX-aarch64.nativelib
479 - name: Run Java Tests against release bins
481 if [ "${{ matrix.platform }}" != "macos-11" ]; then
482 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
483 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
484 export PATH=$JAVA_HOME/bin:$PATH
485 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
487 mvn -q -B -DskipTests=true package
488 JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
489 mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
492 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar