diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a0bf1356..8e0be61c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,9 @@ jobs: profile: minimal - name: Build on Rust ${{ matrix.toolchain }} run: cargo build --verbose --color always - - name: Check formatting + - name: Check release build on Rust ${{ matrix.toolchain }} + run: cargo check --release --verbose --color always + - name: Check formatting on Rust ${{ matrix.toolchain }} if: matrix.check-fmt run: rustup component add rustfmt && cargo fmt --all -- --check - name: Test on Rust ${{ matrix.toolchain }} diff --git a/scripts/uniffi_bindgen_generate.sh b/scripts/uniffi_bindgen_generate.sh index 2fcd46b88..0658cabdb 100755 --- a/scripts/uniffi_bindgen_generate.sh +++ b/scripts/uniffi_bindgen_generate.sh @@ -1,5 +1,5 @@ #!/bin/bash -source ./scripts/uniffi_bindgen_generate_kotlin.sh -source ./scripts/uniffi_bindgen_generate_python.sh -source ./scripts/uniffi_bindgen_generate_swift.sh +source ./scripts/uniffi_bindgen_generate_kotlin.sh || exit 1 +source ./scripts/uniffi_bindgen_generate_python.sh || exit 1 +source ./scripts/uniffi_bindgen_generate_swift.sh || exit 1 diff --git a/scripts/uniffi_bindgen_generate_kotlin.sh b/scripts/uniffi_bindgen_generate_kotlin.sh index bd8410c13..84d5e3534 100755 --- a/scripts/uniffi_bindgen_generate_kotlin.sh +++ b/scripts/uniffi_bindgen_generate_kotlin.sh @@ -1,15 +1,18 @@ #!/bin/bash -BINDINGS_DIR="./bindings/kotlin" -TARGET_DIR="./target/bindings/kotlin" +BINDINGS_DIR="bindings/kotlin" +TARGET_DIR="target/bindings/kotlin" PROJECT_DIR="ldk-node-jvm" PACKAGE_DIR="org/lightningdevkit/ldknode" UNIFFI_BINDGEN_BIN="cargo run --features=uniffi/cli --bin uniffi-bindgen" -cargo build --target aarch64-apple-darwin -$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language kotlin -o "$TARGET_DIR" +#rustup target add aarch64-apple-darwin +#cargo build --target aarch64-apple-darwin || exit 1 +cargo build --release || exit 1 +$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language kotlin -o "$TARGET_DIR" || exit 1 -mkdir -p "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR" -mkdir -p "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/resources/darwin-aarch64/ +mkdir -p "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR" || exit 1 +mkdir -p "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/resources/darwin-aarch64/ || exit 1 -cp "$TARGET_DIR"/"$PACKAGE_DIR"/ldk_node.kt "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR"/ -cp ./target/aarch64-apple-darwin/debug/libldk_node.dylib "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/resources/darwin-aarch64/libldk_node.dylib +cp "$TARGET_DIR"/"$PACKAGE_DIR"/ldk_node.kt "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/kotlin/"$PACKAGE_DIR"/ || exit 1 +#cp ./target/aarch64-apple-darwin/debug/libldk_node.dylib "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/resources/darwin-aarch64/libldk_node.dylib || exit 1 +cp target/release/libldk_node.dylib "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/resources/libldk_node.dylib || exit 1 diff --git a/scripts/uniffi_bindgen_generate_swift.sh b/scripts/uniffi_bindgen_generate_swift.sh index 4eef432d7..d821581e2 100755 --- a/scripts/uniffi_bindgen_generate_swift.sh +++ b/scripts/uniffi_bindgen_generate_swift.sh @@ -2,8 +2,8 @@ BINDINGS_DIR="./bindings/swift" UNIFFI_BINDGEN_BIN="cargo run --features=uniffi/cli --bin uniffi-bindgen" -cargo build --release -$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language swift -o "$BINDINGS_DIR" +cargo build --release || exit 1 +$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language swift -o "$BINDINGS_DIR" || exit 1 mkdir -p $BINDINGS_DIR