Use macos-13 image to test and publish Python libraries
This commit is contained in:
parent
8b66ac96ab
commit
279847b024
4
.github/workflows/publish-python.yaml
vendored
4
.github/workflows/publish-python.yaml
vendored
@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
build-macos-universal-wheel:
|
build-macos-universal-wheel:
|
||||||
name: "Build macOS universal wheel"
|
name: "Build macOS universal wheel"
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
@ -85,7 +85,7 @@ jobs:
|
|||||||
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
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_13_0_universal2 --verbose
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
98
.github/workflows/test-python.yaml
vendored
98
.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,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- 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 requirements"
|
# - name: "Install requirements"
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
# 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,22 +68,20 @@ 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
|
||||||
@ -92,16 +90,53 @@ 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-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
|
||||||
|
|
||||||
|
# You can't install the arm64 wheel on the CI, so we skip these steps and simply test that the wheel builds
|
||||||
|
# - name: "Install wheel and run tests"
|
||||||
|
# run: |
|
||||||
|
# pip3 install ./dist/*.whl
|
||||||
|
# python3 -m unittest tests/test_bdk.py --verbose
|
||||||
|
|
||||||
|
- name: "Upload artifact test"
|
||||||
|
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 and test macOS x86_64 wheels"
|
||||||
|
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
|
||||||
|
- 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
|
||||||
|
|
||||||
- name: "Install wheel"
|
- name: "Install wheel"
|
||||||
run: pip3 install ./dist/*.whl
|
run: pip3 install ./dist/*.whl
|
||||||
@ -109,7 +144,13 @@ jobs:
|
|||||||
- name: "Run tests"
|
- name: "Run tests"
|
||||||
run: python3 -m unittest tests/test_bdk.py --verbose
|
run: python3 -m unittest tests/test_bdk.py --verbose
|
||||||
|
|
||||||
build-windows-wheel:
|
- 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"
|
name: "Build and test Windows wheels"
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
defaults:
|
defaults:
|
||||||
@ -131,14 +172,17 @@ jobs:
|
|||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
- name: "Generate bdk.py"
|
||||||
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
|
||||||
|
|
||||||
|
- name: "Upload artifact test"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-windows-${{ matrix.python }}
|
||||||
|
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
||||||
|
|
||||||
# TODO: On Windows the pip install ./dist/*.whl step fails with the following error:
|
# TODO: On Windows the pip install ./dist/*.whl step fails with the following error:
|
||||||
# Run pip install ./dist/*.whl
|
# Run pip install ./dist/*.whl
|
||||||
# WARNING: Requirement './dist/*.whl' looks like a filename, but the file does not exist
|
# WARNING: Requirement './dist/*.whl' looks like a filename, but the file does not exist
|
||||||
|
@ -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
|
||||||
|
@ -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!"
|
22
bdk-python/scripts/generate-windows.sh
Normal file
22
bdk-python/scripts/generate-windows.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/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 "Printing the content of the bdkpython directory..."
|
||||||
|
ls -la ../bdk-python/src/bdkpython/
|
||||||
|
|
||||||
|
echo "All done!"
|
Loading…
x
Reference in New Issue
Block a user