Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Compile bdk-jvm For All Targets
on: [workflow_dispatch]

permissions: {}

jobs:
build-macOS-native-libs:
name: "Create M1 and x86_64 native binaries"
runs-on: macos-14
steps:
- name: "Checkout publishing branch"
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
fetch-depth: 0

- name: "Set up JDK"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: "Build bdk-jvm library"
run: |
bash ./scripts/build-macos-aarch64.sh
bash ./scripts/build-macos-x86_64.sh

- name: "Upload macOS native libraries"
uses: actions/upload-artifact@v4
with:
name: artifact-macos
path: /Users/runner/work/bdk-jvm/bdk-jvm/lib/src/main/resources/

build-windows-native-lib:
name: "Create Windows native binaries"
runs-on: windows-2022
steps:
- name: "Checkout publishing branch"
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
fetch-depth: 0

- name: "Set up JDK"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: "Build bdk-jvm library"
run: bash ./scripts/build-windows-x86_64.sh

- name: "Upload Windows native libraries"
uses: actions/upload-artifact@v4
with:
name: artifact-windows
path: D:\a\bdk-jvm\bdk-jvm\lib\src\main\resources\

build-full-library:
name: Create full bdk-jvm library
needs: [build-macOS-native-libs, build-windows-native-lib]
runs-on: ubuntu-24.04
steps:
- name: "Checkout publishing branch"
uses: actions/checkout@v4
with:
submodules: recursive
persist-credentials: false
fetch-depth: 0

- name: "Set up JDK"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: "Build bdk-jvm library"
run: bash ./scripts/build-linux-x86_64.sh

- name: "Download macOS native binaries from previous job"
uses: actions/download-artifact@v4
with:
name: artifact-macos
path: ./bdk-jvm/lib/src/main/resources/

- name: "Download Windows native libraries from previous job"
uses: actions/download-artifact@v4
with:
name: artifact-windows
path: ./bdk-jvm/lib/src/main/resources/

- name: "Upload library code and binaries"
uses: actions/upload-artifact@v4
with:
name: artifact-full
path: ./bdk-jvm/lib/
3 changes: 3 additions & 0 deletions scripts/build-linux-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ TARGET_DIR="target/x86_64-unknown-linux-gnu/release-smaller"
RESOURCE_DIR="resources/linux-x86-64"
LIB_NAME="libbdkffi.so"

echo "Making sure the submodule is initialized..."
git submodule update --init

# Move to the Rust library directory
cd ./bdk-ffi/bdk-ffi/ || exit

Expand Down
3 changes: 3 additions & 0 deletions scripts/build-macos-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ TARGET_DIR="target/$COMPILATION_TARGET/release-smaller"
RESOURCE_DIR="resources/darwin-aarch64"
LIB_NAME="libbdkffi.dylib"

echo "Making sure the submodule is initialized..."
git submodule update --init

# Move to the Rust library directory
cd ./bdk-ffi/bdk-ffi/ || exit

Expand Down
3 changes: 3 additions & 0 deletions scripts/build-macos-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ TARGET_DIR="target/x86_64-apple-darwin/release-smaller"
RESOURCE_DIR="resources/darwin-x86-64"
LIB_NAME="libbdkffi.dylib"

echo "Making sure the submodule is initialized..."
git submodule update --init

# Move to the Rust library directory
cd ./bdk-ffi/bdk-ffi/ || exit

Expand Down
3 changes: 3 additions & 0 deletions scripts/build-windows-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ TARGET_DIR="target/x86_64-pc-windows-msvc/release-smaller"
RESOURCE_DIR="resources/win32-x86-64"
LIB_NAME="bdkffi.dll"

echo "Making sure the submodule is initialized..."
git submodule update --init

# Move to the Rust library directory
cd ./bdk-ffi/bdk-ffi/ || exit

Expand Down