Compare commits
9 Commits
frost
...
release/0.
Author | SHA1 | Date | |
---|---|---|---|
|
486abb7cd0 | ||
|
21915a1466 | ||
|
ee4ec924a1 | ||
|
12f8d557ad | ||
|
ea0256f470 | ||
|
ee56e8f4e1 | ||
|
4fb5f970c2 | ||
|
279847b024 | ||
|
8b66ac96ab |
107
.github/workflows/publish-jvm.yaml
vendored
107
.github/workflows/publish-jvm.yaml
vendored
@ -2,14 +2,14 @@ name: Publish bdk-jvm to Maven Central
|
|||||||
on: [workflow_dispatch]
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-jvm-macOS-M1-native-lib:
|
build-macOS-native-libs:
|
||||||
name: "Create M1 and x86_64 JVM native binaries"
|
name: "Create M1 and x86_64 native binaries"
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout publishing branch"
|
- name: "Checkout publishing branch"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Cache
|
- name: "Cache"
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@ -18,7 +18,7 @@ jobs:
|
|||||||
./target
|
./target
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: "Set up JDK"
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@ -27,45 +27,28 @@ jobs:
|
|||||||
- name: "Set default Rust version to 1.67.0"
|
- name: "Set default Rust version to 1.67.0"
|
||||||
run: rustup default 1.67.0
|
run: rustup default 1.67.0
|
||||||
|
|
||||||
- name: Install aarch64 Rust target
|
- name: "Install aarch64 Rust target"
|
||||||
run: rustup target add aarch64-apple-darwin
|
run: rustup target add aarch64-apple-darwin
|
||||||
|
|
||||||
- name: Build bdk-jvm library
|
- name: "Build bdk-jvm library"
|
||||||
run: |
|
run: |
|
||||||
cd bdk-jvm
|
cd bdk-jvm
|
||||||
./gradlew buildJvmLib
|
./gradlew buildJvmLib
|
||||||
|
|
||||||
# build aarch64 + x86_64 native libraries and upload
|
- name: "Upload macOS native libraries for reuse in publishing job"
|
||||||
- name: Upload macOS native libraries for reuse in publishing job
|
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
# name: no name is required because we upload the entire directory
|
name: artifact-macos
|
||||||
# the default name "artifact" will be used
|
|
||||||
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-jvm/lib/src/main/resources/
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-jvm/lib/src/main/resources/
|
||||||
|
|
||||||
build-jvm-full-library:
|
build-windows-native-lib:
|
||||||
name: Create full bdk-jvm library
|
name: "Create Windows native binaries"
|
||||||
needs: [build-jvm-macOS-M1-native-lib]
|
runs-on: windows-2022
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout publishing branch
|
- name: "Checkout publishing branch"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Update bdk-ffi git submodule
|
- name: "Set up JDK"
|
||||||
run: |
|
|
||||||
git submodule set-url bdk-ffi https://github.com/bitcoindevkit/bdk-ffi.git
|
|
||||||
git submodule update --init bdk-ffi
|
|
||||||
|
|
||||||
- name: Cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
./target
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Set up JDK
|
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@ -74,20 +57,70 @@ jobs:
|
|||||||
- name: "Set default Rust version to 1.67.0"
|
- name: "Set default Rust version to 1.67.0"
|
||||||
run: rustup default 1.67.0
|
run: rustup default 1.67.0
|
||||||
|
|
||||||
- name: Build bdk-jvm library
|
- name: "Install x86_64-pc-windows-msvc Rust target"
|
||||||
|
run: rustup target add x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
- name: "Build bdk-jvm library"
|
||||||
run: |
|
run: |
|
||||||
cd bdk-jvm
|
cd bdk-jvm
|
||||||
./gradlew buildJvmLib
|
./gradlew buildJvmLib
|
||||||
|
|
||||||
- name: Download macOS native libraries from previous job
|
- name: "Upload Windows native libraries for reuse in publishing job"
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
id: download
|
|
||||||
with:
|
with:
|
||||||
# download the artifact created in the prior job (named "artifact")
|
name: artifact-windows
|
||||||
name: artifact
|
path: D:\a\bdk-ffi\bdk-ffi\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-20.04
|
||||||
|
steps:
|
||||||
|
- name: "Checkout publishing branch"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: "Cache"
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
./target
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: "Set up JDK"
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
- name: "Set default Rust version to 1.67.0"
|
||||||
|
run: rustup default 1.67.0
|
||||||
|
|
||||||
|
- name: "Build bdk-jvm library"
|
||||||
|
run: |
|
||||||
|
cd bdk-jvm
|
||||||
|
./gradlew buildJvmLib
|
||||||
|
|
||||||
|
- name: "Download native binaries from previous jobs"
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-macos
|
||||||
path: ./bdk-jvm/lib/src/main/resources/
|
path: ./bdk-jvm/lib/src/main/resources/
|
||||||
|
|
||||||
- name: Publish to Maven Central
|
- name: "Download Windows native libraries from previous job"
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-windows
|
||||||
|
path: ./bdk-jvm/lib/src/main/resources/
|
||||||
|
|
||||||
|
- name: "Upload library code and binaries"
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-full
|
||||||
|
path: ./bdk-jvm/lib/
|
||||||
|
|
||||||
|
- name: "Publish to Maven Central"
|
||||||
env:
|
env:
|
||||||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PGP_KEY_ID }}
|
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PGP_KEY_ID }}
|
||||||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET_KEY }}
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET_KEY }}
|
||||||
|
81
.github/workflows/publish-python.yaml
vendored
81
.github/workflows/publish-python.yaml
vendored
@ -7,7 +7,7 @@ on: [workflow_dispatch]
|
|||||||
# tries to load glibc and fails because it requires a more recent version.
|
# tries to load glibc and fails because it requires a more recent version.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-manylinux2014-x86_64-wheel:
|
build-manylinux2014-x86_64-wheels:
|
||||||
name: "Build Manylinux 2014 x86_64 wheel"
|
name: "Build Manylinux 2014 x86_64 wheel"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
defaults:
|
defaults:
|
||||||
@ -33,14 +33,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: "Set default Rust version to 1.67.0"
|
|
||||||
run: rustup default 1.67.0
|
|
||||||
|
|
||||||
- name: "Install requirements"
|
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: bash generate.sh
|
run: bash ./scripts/generate-linux.sh
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
@ -52,9 +46,9 @@ jobs:
|
|||||||
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
||||||
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-macos-universal-wheel:
|
build-macos-arm64-wheels:
|
||||||
name: "Build macOS universal wheel"
|
name: "Build macOS arm64 wheel"
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
@ -69,30 +63,63 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-macos-arm64.sh
|
||||||
python3 --version
|
|
||||||
rustup target add aarch64-apple-darwin
|
|
||||||
pip3 install --user -r requirements.txt
|
|
||||||
bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
env:
|
|
||||||
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
|
||||||
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
# see issue #350 for more information
|
# see issue #350 for more information
|
||||||
run: python3 setup.py bdist_wheel --plat-name macosx_12_0_universal2 --verbose
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose
|
||||||
|
|
||||||
|
- name: "Upload artifacts"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-macos-arm64-${{ matrix.python }}
|
||||||
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
|
build-macos-x86_64-wheels:
|
||||||
|
name: "Build macOS x86_64 wheel"
|
||||||
|
runs-on: macos-13
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: bdk-python
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python:
|
||||||
|
- "3.8"
|
||||||
|
- "3.9"
|
||||||
|
- "3.10"
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
- name: "Generate bdk.py and binaries"
|
||||||
|
run: bash ./scripts/generate-macos-x86_64.sh
|
||||||
|
|
||||||
|
- name: "Build wheel"
|
||||||
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: bdkpython-macos-${{ matrix.python }}
|
name: bdkpython-macos-x86_64-${{ matrix.python }}
|
||||||
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-windows-wheel:
|
build-windows-wheels:
|
||||||
name: "Build Windows wheel"
|
name: "Build Windows wheel"
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
defaults:
|
defaults:
|
||||||
@ -114,15 +141,13 @@ jobs:
|
|||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-windows.sh
|
||||||
python --version
|
|
||||||
pip install --user -r requirements.txt
|
|
||||||
bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
run: python setup.py bdist_wheel --verbose
|
run: python setup.py bdist_wheel --verbose
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- name: "Upload artifacts"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: bdkpython-win-${{ matrix.python }}
|
name: bdkpython-win-${{ matrix.python }}
|
||||||
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
||||||
@ -133,7 +158,7 @@ jobs:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
needs: [build-manylinux2014-x86_64-wheel, build-macos-universal-wheel, build-windows-wheel]
|
needs: [build-manylinux2014-x86_64-wheels, build-macos-arm64-wheels, build-macos-x86_64-wheels, build-windows-wheels]
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
129
.github/workflows/test-python.yaml
vendored
129
.github/workflows/test-python.yaml
vendored
@ -16,7 +16,7 @@ on:
|
|||||||
# tries to load glibc and fails because it requires a more recent version.
|
# tries to load glibc and fails because it requires a more recent version.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-manylinux2014-x86_64-wheel:
|
build-manylinux2014-x86_64-wheels:
|
||||||
name: "Build and test Manylinux 2014 x86_64 wheels"
|
name: "Build and test Manylinux 2014 x86_64 wheels"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
defaults:
|
defaults:
|
||||||
@ -42,14 +42,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: "Set default Rust version to 1.67.0"
|
|
||||||
run: rustup default 1.67.0
|
|
||||||
|
|
||||||
- name: "Install requirements"
|
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: bash generate.sh
|
run: bash ./scripts/generate-linux.sh
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
@ -68,50 +62,52 @@ jobs:
|
|||||||
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
||||||
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-macos-universal-wheel:
|
build-macos-arm64-wheels:
|
||||||
name: "Build and test macOS wheels"
|
name: "Build and test macOS arm64 wheels"
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python:
|
python:
|
||||||
# 3.8 returns an error for the macos-12 image when we try to install the wheel:
|
- "3.8"
|
||||||
# bdkpython-0.28.0.dev0-cp38-cp38-macosx_12_0_universal2.whl is not a supported wheel on this platform.
|
|
||||||
# - "3.8"
|
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py and binaries"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-macos-arm64.sh
|
||||||
python3 --version
|
|
||||||
rustup target add aarch64-apple-darwin
|
|
||||||
pip3 install --user -r requirements.txt
|
|
||||||
bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
env:
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
# see issue #350 for more information
|
||||||
run: python3 setup.py bdist_wheel --plat-name macosx_12_0_universal2 --verbose
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose
|
||||||
|
|
||||||
- name: "Install wheel"
|
# You can't install the arm64 wheel on the CI, so we skip these steps and simply test that the wheel builds
|
||||||
run: pip3 install ./dist/*.whl
|
# - name: "Install wheel and run tests"
|
||||||
|
# run: |
|
||||||
|
# pip3 install ./dist/*.whl
|
||||||
|
# python3 -m unittest tests/test_bdk.py --verbose
|
||||||
|
|
||||||
- name: "Run tests"
|
- name: "Upload artifact test"
|
||||||
run: python3 -m unittest tests/test_bdk.py --verbose
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-macos-arm64-${{ matrix.python }}
|
||||||
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-windows-wheel:
|
build-macos-x86_64-wheels:
|
||||||
name: "Build and test Windows wheels"
|
name: "Build and test macOS x86_64 wheels"
|
||||||
runs-on: windows-2022
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
@ -130,21 +126,64 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-macos-x86_64.sh
|
||||||
python --version
|
|
||||||
pip install --user -r requirements.txt
|
- name: "Build wheel"
|
||||||
bash generate.sh
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose
|
||||||
|
|
||||||
|
- name: "Install wheel"
|
||||||
|
run: pip3 install ./dist/*.whl
|
||||||
|
|
||||||
|
- name: "Run tests"
|
||||||
|
run: python3 -m unittest tests/test_bdk.py --verbose
|
||||||
|
|
||||||
|
- name: "Upload artifact test"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-macos-x86_64-${{ matrix.python }}
|
||||||
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
|
build-windows-wheels:
|
||||||
|
name: "Build and test Windows wheels"
|
||||||
|
runs-on: windows-2022
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: bdk-python
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python:
|
||||||
|
- "3.8"
|
||||||
|
- "3.9"
|
||||||
|
- "3.10"
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
- name: "Generate bdk.py and binaries"
|
||||||
|
run: bash ./scripts/generate-windows.sh
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
run: python setup.py bdist_wheel --verbose
|
run: python setup.py bdist_wheel --verbose
|
||||||
|
|
||||||
# TODO: On Windows the pip install ./dist/*.whl step fails with the following error:
|
- name: "Upload artifact test"
|
||||||
# Run pip install ./dist/*.whl
|
uses: actions/upload-artifact@v2
|
||||||
# WARNING: Requirement './dist/*.whl' looks like a filename, but the file does not exist
|
with:
|
||||||
# ERROR: *.whl is not a valid wheel filename.*.whl is not a valid wheel name
|
name: bdkpython-windows-${{ matrix.python }}
|
||||||
# So we skip the installing and the tests and simply test that the wheel builds
|
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
||||||
# - name: Install wheel
|
|
||||||
# run: pip install ./dist/*.whl
|
- name: "Install dependencies"
|
||||||
# - name: Run tests
|
run: Get-ChildItem 'D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl' | ForEach-Object {pip install $_.FullName}
|
||||||
# run: python -m unittest tests/test_bdk.py --verbose
|
shell: powershell
|
||||||
|
|
||||||
|
- name: "Run tests"
|
||||||
|
run: python -m unittest tests/test_bdk.py --verbose
|
||||||
|
@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libraryVersion=0.29.0-SNAPSHOT
|
libraryVersion=0.29.0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536m
|
org.gradle.jvmargs=-Xmx1536m
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libraryVersion=0.29.0-SNAPSHOT
|
libraryVersion=0.29.2
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
include ./src/bdkpython/libbdkffi.dylib
|
include ./src/bdkpython/libbdkffi.dylib
|
||||||
include ./src/bdkpython/libbdkffi.so
|
include ./src/bdkpython/libbdkffi.so
|
||||||
|
include ./src/bdkpython/bdkffi.dll
|
||||||
|
@ -12,9 +12,9 @@ pip install bdkpython
|
|||||||
## Run the tests
|
## Run the tests
|
||||||
```shell
|
```shell
|
||||||
pip install --requirement requirements.txt
|
pip install --requirement requirements.txt
|
||||||
bash ./generate.sh
|
bash ./scripts/generate-linux.sh # here you should run the script appropriate for your platform
|
||||||
python setup.py bdist_wheel --verbose
|
python setup.py bdist_wheel --verbose
|
||||||
pip install ./dist/bdkpython-<yourversion>-py3-none-any.whl --force-reinstall
|
pip install ./dist/bdkpython-<yourversion>.whl --force-reinstall
|
||||||
python -m unittest --verbose tests/test_bdk.py
|
python -m unittest --verbose tests/test_bdk.py
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -23,26 +23,14 @@ python -m unittest --verbose tests/test_bdk.py
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install --requirement requirements.txt
|
pip install --requirement requirements.txt
|
||||||
|
|
||||||
# Generate the bindings
|
# Generate the bindings (use the script appropriate for your platform)
|
||||||
bash generate.sh
|
bash ./scripts/generate-linux.sh
|
||||||
|
|
||||||
# Build the wheel
|
# Build the wheel
|
||||||
python setup.py --verbose bdist_wheel
|
python setup.py --verbose bdist_wheel
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run tox to build and test locally
|
|
||||||
```shell
|
|
||||||
# install dev requirements
|
|
||||||
pip install --requirement requirements-dev.txt
|
|
||||||
|
|
||||||
# build bindings glue code (located at ./src/bdkpython/bdk.py)
|
|
||||||
source ./generate.sh
|
|
||||||
|
|
||||||
# build and test
|
|
||||||
tox -vv
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install locally
|
## Install locally
|
||||||
```shell
|
```shell
|
||||||
pip install ./dist/bdkpython-<yourversion>-py3-none-any.whl
|
pip install ./dist/bdkpython-<yourversion>.whl
|
||||||
```
|
```
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
OS=$(uname -s)
|
|
||||||
|
|
||||||
echo "Generating bdk.py..."
|
|
||||||
cd ../bdk-ffi/
|
|
||||||
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
|
||||||
|
|
||||||
echo "Generating native binaries..."
|
|
||||||
cargo build --profile release-smaller
|
|
||||||
case $OS in
|
|
||||||
"Darwin")
|
|
||||||
echo "Copying macOS libbdkffi.dylib..."
|
|
||||||
cp ../target/release-smaller/libbdkffi.dylib ../bdk-python/src/bdkpython/libbdkffi.dylib
|
|
||||||
;;
|
|
||||||
"Linux")
|
|
||||||
echo "Copying linux libbdkffi.so..."
|
|
||||||
cp ../target/release-smaller/libbdkffi.so ../bdk-python/src/bdkpython/libbdkffi.so
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
cd ../bdk-python/
|
|
||||||
|
|
||||||
echo "All done!"
|
|
18
bdk-python/scripts/generate-linux.sh
Normal file
18
bdk-python/scripts/generate-linux.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
${PYBIN}/python --version
|
||||||
|
${PYBIN}/pip install -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup default 1.67.0
|
||||||
|
cargo build --profile release-smaller
|
||||||
|
|
||||||
|
echo "Copying linux libbdkffi.so..."
|
||||||
|
cp ../target/release-smaller/libbdkffi.so ../bdk-python/src/bdkpython/libbdkffi.so
|
||||||
|
|
||||||
|
echo "All done!"
|
19
bdk-python/scripts/generate-macos-arm64.sh
Normal file
19
bdk-python/scripts/generate-macos-arm64.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
python3 --version
|
||||||
|
pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup default 1.67.0
|
||||||
|
rustup target add aarch64-apple-darwin
|
||||||
|
cargo build --profile release-smaller --target aarch64-apple-darwin
|
||||||
|
|
||||||
|
echo "Copying libraries libbdkffi.dylib..."
|
||||||
|
cp ../target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-python/src/bdkpython/libbdkffi.dylib
|
||||||
|
|
||||||
|
echo "All done!"
|
18
bdk-python/scripts/generate-macos-x86_64.sh
Normal file
18
bdk-python/scripts/generate-macos-x86_64.sh
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
python3 --version
|
||||||
|
pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup target add x86_64-apple-darwin
|
||||||
|
cargo build --profile release-smaller --target x86_64-apple-darwin
|
||||||
|
|
||||||
|
echo "Copying libraries libbdkffi.dylib..."
|
||||||
|
cp ../target/x86_64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-python/src/bdkpython/libbdkffi.dylib
|
||||||
|
|
||||||
|
echo "All done!"
|
19
bdk-python/scripts/generate-windows.sh
Normal file
19
bdk-python/scripts/generate-windows.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
python3 --version
|
||||||
|
pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup default 1.67.0
|
||||||
|
rustup target add x86_64-pc-windows-msvc
|
||||||
|
cargo build --profile release-smaller --target x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
echo "Copying libraries bdkffi.dll..."
|
||||||
|
cp ../target/x86_64-pc-windows-msvc/release-smaller/bdkffi.dll ../bdk-python/src/bdkpython/bdkffi.dll
|
||||||
|
|
||||||
|
echo "All done!"
|
@ -51,7 +51,7 @@ print(f"Wallet balance is: {balance.total}")
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="bdkpython",
|
name="bdkpython",
|
||||||
version="0.29.0.dev0",
|
version="0.29.1",
|
||||||
description="The Python language bindings for the Bitcoin Development Kit",
|
description="The Python language bindings for the Bitcoin Development Kit",
|
||||||
long_description=LONG_DESCRIPTION,
|
long_description=LONG_DESCRIPTION,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user