From f618d07d82aaf4873660afdec30467dca7e33496 Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:32:14 +0200 Subject: [PATCH 01/14] Setup python package --- libs/sdk-bindings/bindings-python/.gitignore | 2 ++ libs/sdk-bindings/bindings-python/makefile | 13 +++++++++++++ libs/sdk-bindings/bindings-python/pyproject.toml | 3 +++ libs/sdk-bindings/bindings-python/setup.py | 16 ++++++++++++++++ .../bindings-python/src/breez_sdk/__init__.py | 1 + 5 files changed, 35 insertions(+) create mode 100644 libs/sdk-bindings/bindings-python/.gitignore create mode 100644 libs/sdk-bindings/bindings-python/makefile create mode 100644 libs/sdk-bindings/bindings-python/pyproject.toml create mode 100644 libs/sdk-bindings/bindings-python/setup.py create mode 100644 libs/sdk-bindings/bindings-python/src/breez_sdk/__init__.py diff --git a/libs/sdk-bindings/bindings-python/.gitignore b/libs/sdk-bindings/bindings-python/.gitignore new file mode 100644 index 000000000..4041fa814 --- /dev/null +++ b/libs/sdk-bindings/bindings-python/.gitignore @@ -0,0 +1,2 @@ +src/breez_sdk/breez_sdk.py +src/breez_sdk/*.dylib diff --git a/libs/sdk-bindings/bindings-python/makefile b/libs/sdk-bindings/bindings-python/makefile new file mode 100644 index 000000000..f17739fa0 --- /dev/null +++ b/libs/sdk-bindings/bindings-python/makefile @@ -0,0 +1,13 @@ +.PHONY: init +init: + make -C ../ init + +darwin: + make -C ../ python-darwin + cp ../ffi/python/breez_sdk.py src/breez_sdk + cp ../ffi/python/libbreez_sdk_bindings.dylib src/breez_sdk + +linux: + make -C ../ python-linux + cp ../ffi/python/breez_sdk.py src/breez_sdk + cp ../ffi/python/libbreez_sdk_bindings.dylib src/breez_sdk diff --git a/libs/sdk-bindings/bindings-python/pyproject.toml b/libs/sdk-bindings/bindings-python/pyproject.toml new file mode 100644 index 000000000..fed528d4a --- /dev/null +++ b/libs/sdk-bindings/bindings-python/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/libs/sdk-bindings/bindings-python/setup.py b/libs/sdk-bindings/bindings-python/setup.py new file mode 100644 index 000000000..a5348ac63 --- /dev/null +++ b/libs/sdk-bindings/bindings-python/setup.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +from setuptools import setup + +setup( + name="breez_sdk", + version="0.2.7.dev0", + description="Python language bindings for the Breez SDK", + include_package_data=True, + packages=["breez_sdk"], + package_dir={"breez_sdk": "./src/breez_sdk"}, + url="https://github.com/breez/breez-sdk", + author="Breez ", + license="MIT", + has_ext_modules=lambda: True, +) diff --git a/libs/sdk-bindings/bindings-python/src/breez_sdk/__init__.py b/libs/sdk-bindings/bindings-python/src/breez_sdk/__init__.py new file mode 100644 index 000000000..054d9d339 --- /dev/null +++ b/libs/sdk-bindings/bindings-python/src/breez_sdk/__init__.py @@ -0,0 +1 @@ +from breez_sdk.breez_sdk import * From ccbe870aacf88fb66cbc9d4d094c63ca89afa2a2 Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Fri, 27 Oct 2023 20:12:41 +0200 Subject: [PATCH 02/14] Add CI --- .github/workflows/publish-all-platforms.yml | 27 ++++- .github/workflows/publish-python.yml | 111 +++++++++++++++++++ libs/sdk-bindings/bindings-python/.gitignore | 3 + libs/sdk-bindings/bindings-python/setup.py | 21 +++- 4 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/publish-python.yml diff --git a/.github/workflows/publish-all-platforms.yml b/.github/workflows/publish-all-platforms.yml index 03258c463..58931edc9 100644 --- a/.github/workflows/publish-all-platforms.yml +++ b/.github/workflows/publish-all-platforms.yml @@ -34,6 +34,10 @@ on: description: 'version for the react native package (MAJOR.MINOR.BUILD)' required: false type: string + python-package-version: + description: 'version for the python package (MAJOR.MINOR.BUILD)' + required: false + type: string publish: description: 'boolean indicating whether packages should be published. true to publish. false to build only. Default = false.' required: false @@ -58,6 +62,7 @@ jobs: kotlin-mpp-package-version: ${{ inputs.kotlin-mpp-package-version }} flutter-package-version: ${{ inputs.flutter-package-version }} react-native-package-version: ${{ inputs.react-native-package-version }} + python-package-version: ${{ inputs.python-package-version }} publish: ${{ inputs.publish }} steps: - run: echo "set pre-setup output variables" @@ -73,13 +78,13 @@ jobs: # to set these variables here to `true` or `false` # (e.g. bindings-windows: true) if you want to test something. bindings-windows: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} - bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} - bindings-linux: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} + bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }} + bindings-linux: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version}} bindings-android: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.flutter-package-version }} bindings-ios: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version }} kotlin: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version }} swift: false - python: false + python: ${{ !!needs.pre-setup.outputs.python-package-version }} csharp: ${{ !!needs.pre-setup.outputs.csharp-package-version }} golang: ${{ !!needs.pre-setup.outputs.golang-package-version }} maven: ${{ !!needs.pre-setup.outputs.maven-package-version }} @@ -94,6 +99,7 @@ jobs: kotlin-mpp-package-version: ${{ needs.pre-setup.outputs.kotlin-mpp-package-version || '0.0.2' }} flutter-package-version: ${{ needs.pre-setup.outputs.flutter-package-version || '0.0.2' }} react-native-package-version: ${{ needs.pre-setup.outputs.react-native-package-version || '0.0.2' }} + python-package-version: ${{ needs.pre-setup.outputs.python-package-version || '0.0.2' }} publish: ${{ needs.pre-setup.outputs.publish }} steps: - run: echo "set setup output variables" @@ -230,3 +236,18 @@ jobs: publish: ${{ needs.setup.outputs.publish == 'true' }} secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-python: + needs: + - setup + - build-bindings-darwin + - build-bindings-linux + - build-language-bindings + if: ${{ needs.setup.outputs.python == 'true' }} + uses: ./.github/workflows/publish-python.yml + with: + ref: ${{ needs.setup.outputs.ref }} + package-version: ${{ needs.setup.outputs.python-package-version }} + publish: ${{ needs.setup.outputs.publish == 'true' }} + secrets: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml new file mode 100644 index 000000000..cc6de1d34 --- /dev/null +++ b/.github/workflows/publish-python.yml @@ -0,0 +1,111 @@ +name: Publish Python Bindings +on: + workflow_call: + inputs: + ref: + description: 'commit/tag/branch reference' + required: true + type: string + package-version: + description: 'version for the python package (MAJOR.MINOR.BUILD)' + required: true + type: string + publish: + description: 'value indicating whether to publish to pypi.' + required: true + type: boolean + default: false + secrets: + PYPI_API_TOKEN: + description: 'api token to authenticate to pypi' + required: true + +jobs: + build-macos-wheels: + runs-on: macos-latest + strategy: + matrix: + python: + - "3.8" + - "3.9" + - "3.10" + steps: + - name: Checkout breez-sdk repo + uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref || github.sha }} + + - name: "Install Python" + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-darwin-universal + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - uses: actions/download-artifact@v3 + with: + name: bindings-python + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - name: Clean up downloaded files + run: | + rm -f libs/sdk-bindings/bindings-python/src/breez_sdk/*.a + ls -R libs/sdk-bindings/bindings-python + + - name: Update package version + if: ${{ inputs.package-version }} + working-directory: libs/sdk-bindings/bindings-python + run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py + + - name: Install dependencies + working-directory: libs/sdk-bindings/bindings-python + run: pip3 install wheel setuptools + + - name: Build wheel + working-directory: libs/sdk-bindings/bindings-python + run: python3 setup.py bdist_wheel --plat-name macosx_11_0_universal2 --verbose + + - name: List wheel contents + working-directory: libs/sdk-bindings/bindings-python/dist + run: python3 -m zipfile --list *.whl || true + + - name: Archive the wheel + uses: actions/upload-artifact@v3 + with: + name: python-${{ matrix.python }}-macos-wheel + path: libs/sdk-bindings/bindings-python/dist/*.whl + + publish-package: + runs-on: ubuntu-latest + needs: [build-macos-wheels] + steps: + - name: Checkout breez-sdk repo + uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref || github.sha }} + + - name: Download wheels + uses: actions/download-artifact@v3 + with: + path: libs/sdk-bindings/bindings-python/dist/ + + - name: Clean downloaded contents + working-directory: libs/sdk-bindings/bindings-python + run: | + echo "Artifacts before cleaning" + ls -laR dist + find dist -maxdepth 1 ! -path dist ! -name "python*" -exec rm -rf {} \; + echo "Artifacts after cleaning" + ls -laR dist + + - name: "Publish on test PyPI" + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + packages_dir: libs/sdk-bindings/bindings-python/dist/*/ diff --git a/libs/sdk-bindings/bindings-python/.gitignore b/libs/sdk-bindings/bindings-python/.gitignore index 4041fa814..41a367527 100644 --- a/libs/sdk-bindings/bindings-python/.gitignore +++ b/libs/sdk-bindings/bindings-python/.gitignore @@ -1,2 +1,5 @@ src/breez_sdk/breez_sdk.py src/breez_sdk/*.dylib +*.egg-info +build +dist diff --git a/libs/sdk-bindings/bindings-python/setup.py b/libs/sdk-bindings/bindings-python/setup.py index a5348ac63..e0cf751e5 100644 --- a/libs/sdk-bindings/bindings-python/setup.py +++ b/libs/sdk-bindings/bindings-python/setup.py @@ -2,13 +2,30 @@ from setuptools import setup +LONG_DESCRIPTION = """# Breez SDK +Python language bindings for the [Breez SDK](https://github.com/breez/breez-sdk). + +## Installing + +```shell +pip install breez_sdk +``` + +## Docs + +See [sdk-doc.breez.technology](https://sdk-doc.breez.technology). +""" + setup( name="breez_sdk", - version="0.2.7.dev0", + version="0.2.7.dev9", description="Python language bindings for the Breez SDK", - include_package_data=True, + long_description=LONG_DESCRIPTION, + long_description_content_type="text/markdown", packages=["breez_sdk"], package_dir={"breez_sdk": "./src/breez_sdk"}, + include_package_data=True, + package_data={"breez_sdk": ["*.dylib"]}, url="https://github.com/breez/breez-sdk", author="Breez ", license="MIT", From 47c1a5a12f99445d31cbc961854c7102ef827edf Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Sat, 28 Oct 2023 19:49:37 +0200 Subject: [PATCH 03/14] Add linux wheels to CI --- .github/workflows/publish-python.yml | 88 +++++++++++++++++++++- libs/sdk-bindings/bindings-python/setup.py | 2 +- 2 files changed, 86 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index cc6de1d34..45c22baa6 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -75,12 +75,94 @@ jobs: - name: Archive the wheel uses: actions/upload-artifact@v3 with: - name: python-${{ matrix.python }}-macos-wheel + name: python-wheel-${{ matrix.python }}-macos + path: libs/sdk-bindings/bindings-python/dist/*.whl + + build-manylinux2014-x86_64-wheels: + runs-on: ubuntu-20.04 + container: + image: quay.io/pypa/manylinux2014_x86_64 + env: + PLAT: manylinux2014_x86_64 + PYBIN: "/opt/python/${{ matrix.python }}/bin" + strategy: + matrix: + python: + - "cp38-cp38" + - "cp39-cp39" + - "cp310-cp310" + steps: + - name: "Checkout" + uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-x86_64-unknown-linux-gnu + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - uses: actions/download-artifact@v3 + with: + name: bindings-python + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - name: Update package version + if: ${{ inputs.package-version }} + working-directory: libs/sdk-bindings/bindings-python + run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py + + - name: "Build wheel" + working-directory: libs/sdk-bindings/bindings-python + run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_x86_64 --verbose + + - uses: actions/upload-artifact@v3 + with: + name: python-wheel-${{ matrix.python }}-manylinux2014-x86_64 + path: libs/sdk-bindings/bindings-python/dist/*.whl + + build-manylinux2014-aarch64-wheels: + runs-on: ubuntu-20.04 + container: + image: quay.io/pypa/manylinux2014_x86_64 + env: + PLAT: manylinux2014_aarch64 + PYBIN: "/opt/python/${{ matrix.python }}/bin" + strategy: + matrix: + python: + - "cp38-cp38" + - "cp39-cp39" + - "cp310-cp310" + steps: + - name: "Checkout" + uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-aarch64-unknown-linux-gnu + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - uses: actions/download-artifact@v3 + with: + name: bindings-python + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - name: Update package version + if: ${{ inputs.package-version }} + working-directory: libs/sdk-bindings/bindings-python + run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py + + - name: "Build wheel" + working-directory: libs/sdk-bindings/bindings-python + run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_aarch64 --verbose + + - uses: actions/upload-artifact@v3 + with: + name: python-wheel-${{ matrix.python }}-manylinux2014-aarch64 path: libs/sdk-bindings/bindings-python/dist/*.whl publish-package: runs-on: ubuntu-latest - needs: [build-macos-wheels] + needs: [build-macos-wheels, build-manylinux2014-x86_64-wheels, build-manylinux2014-aarch64-wheels] steps: - name: Checkout breez-sdk repo uses: actions/checkout@v3 @@ -97,7 +179,7 @@ jobs: run: | echo "Artifacts before cleaning" ls -laR dist - find dist -maxdepth 1 ! -path dist ! -name "python*" -exec rm -rf {} \; + find dist -maxdepth 1 ! -path dist ! -name "python-wheel-*" -exec rm -rf {} \; echo "Artifacts after cleaning" ls -laR dist diff --git a/libs/sdk-bindings/bindings-python/setup.py b/libs/sdk-bindings/bindings-python/setup.py index e0cf751e5..40d906071 100644 --- a/libs/sdk-bindings/bindings-python/setup.py +++ b/libs/sdk-bindings/bindings-python/setup.py @@ -25,7 +25,7 @@ packages=["breez_sdk"], package_dir={"breez_sdk": "./src/breez_sdk"}, include_package_data=True, - package_data={"breez_sdk": ["*.dylib"]}, + package_data={"breez_sdk": ["*.dylib", "*.so"]}, url="https://github.com/breez/breez-sdk", author="Breez ", license="MIT", From c3f07c4a25f3cf13ad48e9e455f63d2b7a57da9d Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Sun, 29 Oct 2023 11:31:43 +0100 Subject: [PATCH 04/14] Use matrix builds --- .github/workflows/publish-python.yml | 64 ++++------------------------ 1 file changed, 9 insertions(+), 55 deletions(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 45c22baa6..b8e2d2c6e 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -25,10 +25,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python: - - "3.8" - - "3.9" - - "3.10" + python: ["3.8", "3.9", "3.10"] steps: - name: Checkout breez-sdk repo uses: actions/checkout@v3 @@ -78,26 +75,24 @@ jobs: name: python-wheel-${{ matrix.python }}-macos path: libs/sdk-bindings/bindings-python/dist/*.whl - build-manylinux2014-x86_64-wheels: + build-linux-wheels: runs-on: ubuntu-20.04 container: image: quay.io/pypa/manylinux2014_x86_64 env: - PLAT: manylinux2014_x86_64 + PLAT: manylinux2014_${{ matrix.arch }} PYBIN: "/opt/python/${{ matrix.python }}/bin" strategy: matrix: - python: - - "cp38-cp38" - - "cp39-cp39" - - "cp310-cp310" + arch: [x86_64, aarch64] + python: [cp38-cp38, cp39-cp39, cp310-cp310] steps: - name: "Checkout" uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: - name: sdk-bindings-x86_64-unknown-linux-gnu + name: sdk-bindings-${{ matrix.arch }}-unknown-linux-gnu path: libs/sdk-bindings/bindings-python/src/breez_sdk - uses: actions/download-artifact@v3 @@ -112,57 +107,16 @@ jobs: - name: "Build wheel" working-directory: libs/sdk-bindings/bindings-python - run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_x86_64 --verbose + run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_${{ matrix.arch }} --verbose - uses: actions/upload-artifact@v3 with: - name: python-wheel-${{ matrix.python }}-manylinux2014-x86_64 - path: libs/sdk-bindings/bindings-python/dist/*.whl - - build-manylinux2014-aarch64-wheels: - runs-on: ubuntu-20.04 - container: - image: quay.io/pypa/manylinux2014_x86_64 - env: - PLAT: manylinux2014_aarch64 - PYBIN: "/opt/python/${{ matrix.python }}/bin" - strategy: - matrix: - python: - - "cp38-cp38" - - "cp39-cp39" - - "cp310-cp310" - steps: - - name: "Checkout" - uses: actions/checkout@v3 - - - uses: actions/download-artifact@v3 - with: - name: sdk-bindings-aarch64-unknown-linux-gnu - path: libs/sdk-bindings/bindings-python/src/breez_sdk - - - uses: actions/download-artifact@v3 - with: - name: bindings-python - path: libs/sdk-bindings/bindings-python/src/breez_sdk - - - name: Update package version - if: ${{ inputs.package-version }} - working-directory: libs/sdk-bindings/bindings-python - run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py - - - name: "Build wheel" - working-directory: libs/sdk-bindings/bindings-python - run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_aarch64 --verbose - - - uses: actions/upload-artifact@v3 - with: - name: python-wheel-${{ matrix.python }}-manylinux2014-aarch64 + name: python-wheel-${{ matrix.python }}-manylinux2014-${{ matrix.arch }} path: libs/sdk-bindings/bindings-python/dist/*.whl publish-package: runs-on: ubuntu-latest - needs: [build-macos-wheels, build-manylinux2014-x86_64-wheels, build-manylinux2014-aarch64-wheels] + needs: [build-macos-wheels, build-linux-wheels] steps: - name: Checkout breez-sdk repo uses: actions/checkout@v3 From 91b5db718bab92523585634922786d0e2180c2aa Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Sun, 29 Oct 2023 11:57:51 +0100 Subject: [PATCH 05/14] Fix manylinux tag --- .github/workflows/publish-python.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index b8e2d2c6e..574c06b58 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -107,7 +107,7 @@ jobs: - name: "Build wheel" working-directory: libs/sdk-bindings/bindings-python - run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_${{ matrix.arch }} --verbose + run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux2014_${{ matrix.arch }} --verbose - uses: actions/upload-artifact@v3 with: @@ -137,6 +137,7 @@ jobs: echo "Artifacts after cleaning" ls -laR dist + # for developing, testing, and experimenting - name: "Publish on test PyPI" uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -145,3 +146,11 @@ jobs: password: ${{ secrets.PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ packages_dir: libs/sdk-bindings/bindings-python/dist/*/ + + # - name: "Publish on PyPI" + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # verbose: true + # user: __token__ + # password: ${{ secrets.PYPI_API_TOKEN }} + # packages_dir: libs/sdk-bindings/bindings-python/dist/*/ From 124e486ce18169a061f06ebca9ba5c566475922a Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:36:23 +0100 Subject: [PATCH 06/14] Clean up CI workflow --- .github/workflows/publish-python.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 574c06b58..8f2a5ecd5 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -131,26 +131,23 @@ jobs: - name: Clean downloaded contents working-directory: libs/sdk-bindings/bindings-python run: | - echo "Artifacts before cleaning" - ls -laR dist find dist -maxdepth 1 ! -path dist ! -name "python-wheel-*" -exec rm -rf {} \; - echo "Artifacts after cleaning" ls -laR dist # for developing, testing, and experimenting - - name: "Publish on test PyPI" - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - packages_dir: libs/sdk-bindings/bindings-python/dist/*/ - - # - name: "Publish on PyPI" + # - name: "Publish on test PyPI" # uses: pypa/gh-action-pypi-publish@release/v1 # with: # verbose: true # user: __token__ # password: ${{ secrets.PYPI_API_TOKEN }} + # repository_url: https://test.pypi.org/legacy/ # packages_dir: libs/sdk-bindings/bindings-python/dist/*/ + + - name: "Publish on PyPI" + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: libs/sdk-bindings/bindings-python/dist/*/ From 53e506685e8fb882a638332ccd2c30f3200862d3 Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Sun, 29 Oct 2023 14:51:46 +0100 Subject: [PATCH 07/14] Add readme --- libs/sdk-bindings/bindings-python/README.md | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 libs/sdk-bindings/bindings-python/README.md diff --git a/libs/sdk-bindings/bindings-python/README.md b/libs/sdk-bindings/bindings-python/README.md new file mode 100644 index 000000000..a2621699f --- /dev/null +++ b/libs/sdk-bindings/bindings-python/README.md @@ -0,0 +1,37 @@ +# SDK bindings for Python + +## Usage + +``` +pip install breez_sdk +``` + +``` python +import breez_sdk + +# see https://sdk-doc.breez.technology +``` + +## Python Package + +Run the GitHub workflow 'Publish Python Bindings' when creating a new release of Breez SDK. +It will create wheels for the following Python versions and Platforms and upload them to [PyPi.org](https://pypi.org/project/breez-sdk/). + +### Supported Wheels + +| | GNU/Linux amd64 | GNU/Linux arm64v8 | macOS x86_64 | macos aarch64 | +|-----------------|-----------------|-------------------|--------------|---------------| +| **Python 3.8** | ✅ | ✅ | ✅ | ✅ | +| **Python 3.9** | ✅ | ✅ | ✅ | ✅ | +| **Python 3.10** | ✅ | ✅ | ✅ | ✅ | + +## Building Manually + +To build the package manually inside this directory use the supplied `makefile`: + +``` shell +make darwin # builds the package for macos +make linux # builds the package for linux +``` + +The artifacts will be placed in `src/breez_sdk/`. From 25c25941863b3c6c5dc90cf396dde3f51a51e513 Mon Sep 17 00:00:00 2001 From: Daniel <111755602+cnixbtc@users.noreply.github.com> Date: Thu, 2 Nov 2023 20:44:16 +0100 Subject: [PATCH 08/14] Update .github/workflows/publish-python.yml Co-authored-by: Jesse de Wit --- .github/workflows/publish-python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 8f2a5ecd5..e5d93cf12 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -145,6 +145,7 @@ jobs: # packages_dir: libs/sdk-bindings/bindings-python/dist/*/ - name: "Publish on PyPI" + if: ${{ inputs.publish }} uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true From 1244b7f6dd2f93b7749a0ab8728d84d24204fd50 Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Mon, 6 Nov 2023 18:41:48 +0100 Subject: [PATCH 09/14] Build linux wheels on ubuntu --- .github/workflows/publish-python.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index e5d93cf12..04315ed65 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -77,19 +77,19 @@ jobs: build-linux-wheels: runs-on: ubuntu-20.04 - container: - image: quay.io/pypa/manylinux2014_x86_64 - env: - PLAT: manylinux2014_${{ matrix.arch }} - PYBIN: "/opt/python/${{ matrix.python }}/bin" strategy: matrix: arch: [x86_64, aarch64] - python: [cp38-cp38, cp39-cp39, cp310-cp310] + python: ["3.8", "3.9", "3.10"] steps: - name: "Checkout" uses: actions/checkout@v3 + - name: "Setup Python" + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + - uses: actions/download-artifact@v3 with: name: sdk-bindings-${{ matrix.arch }}-unknown-linux-gnu @@ -105,13 +105,17 @@ jobs: working-directory: libs/sdk-bindings/bindings-python run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py + - name: Install dependencies + working-directory: libs/sdk-bindings/bindings-python + run: pip3 install wheel setuptools + - name: "Build wheel" working-directory: libs/sdk-bindings/bindings-python - run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux2014_${{ matrix.arch }} --verbose + run: python3 setup.py bdist_wheel --plat-name manylinux_2_31_${{ matrix.arch }} --verbose - uses: actions/upload-artifact@v3 with: - name: python-wheel-${{ matrix.python }}-manylinux2014-${{ matrix.arch }} + name: python-wheel-${{ matrix.python }}-manylinux_2_31_${{ matrix.arch }} path: libs/sdk-bindings/bindings-python/dist/*.whl publish-package: From 589e95699ec50da1ffca6407d6d825a28a9b9954 Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Mon, 6 Nov 2023 19:10:17 +0100 Subject: [PATCH 10/14] Remove macos build for testing --- .github/workflows/publish-all-platforms.yml | 4 +- .github/workflows/publish-python.yml | 108 ++++++++++---------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/publish-all-platforms.yml b/.github/workflows/publish-all-platforms.yml index 58931edc9..28187084f 100644 --- a/.github/workflows/publish-all-platforms.yml +++ b/.github/workflows/publish-all-platforms.yml @@ -78,7 +78,7 @@ jobs: # to set these variables here to `true` or `false` # (e.g. bindings-windows: true) if you want to test something. bindings-windows: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} - bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }} + bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} bindings-linux: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version}} bindings-android: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.flutter-package-version }} bindings-ios: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version }} @@ -240,7 +240,7 @@ jobs: publish-python: needs: - setup - - build-bindings-darwin + # - build-bindings-darwin - build-bindings-linux - build-language-bindings if: ${{ needs.setup.outputs.python == 'true' }} diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 04315ed65..47e4b1df0 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -21,59 +21,59 @@ on: required: true jobs: - build-macos-wheels: - runs-on: macos-latest - strategy: - matrix: - python: ["3.8", "3.9", "3.10"] - steps: - - name: Checkout breez-sdk repo - uses: actions/checkout@v3 - with: - ref: ${{ inputs.ref || github.sha }} - - - name: "Install Python" - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - - uses: actions/download-artifact@v3 - with: - name: sdk-bindings-darwin-universal - path: libs/sdk-bindings/bindings-python/src/breez_sdk - - - uses: actions/download-artifact@v3 - with: - name: bindings-python - path: libs/sdk-bindings/bindings-python/src/breez_sdk - - - name: Clean up downloaded files - run: | - rm -f libs/sdk-bindings/bindings-python/src/breez_sdk/*.a - ls -R libs/sdk-bindings/bindings-python - - - name: Update package version - if: ${{ inputs.package-version }} - working-directory: libs/sdk-bindings/bindings-python - run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py - - - name: Install dependencies - working-directory: libs/sdk-bindings/bindings-python - run: pip3 install wheel setuptools - - - name: Build wheel - working-directory: libs/sdk-bindings/bindings-python - run: python3 setup.py bdist_wheel --plat-name macosx_11_0_universal2 --verbose - - - name: List wheel contents - working-directory: libs/sdk-bindings/bindings-python/dist - run: python3 -m zipfile --list *.whl || true - - - name: Archive the wheel - uses: actions/upload-artifact@v3 - with: - name: python-wheel-${{ matrix.python }}-macos - path: libs/sdk-bindings/bindings-python/dist/*.whl + # build-macos-wheels: + # runs-on: macos-latest + # strategy: + # matrix: + # python: ["3.8", "3.9", "3.10"] + # steps: + # - name: Checkout breez-sdk repo + # uses: actions/checkout@v3 + # with: + # ref: ${{ inputs.ref || github.sha }} + + # - name: "Install Python" + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python }} + + # - uses: actions/download-artifact@v3 + # with: + # name: sdk-bindings-darwin-universal + # path: libs/sdk-bindings/bindings-python/src/breez_sdk + + # - uses: actions/download-artifact@v3 + # with: + # name: bindings-python + # path: libs/sdk-bindings/bindings-python/src/breez_sdk + + # - name: Clean up downloaded files + # run: | + # rm -f libs/sdk-bindings/bindings-python/src/breez_sdk/*.a + # ls -R libs/sdk-bindings/bindings-python + + # - name: Update package version + # if: ${{ inputs.package-version }} + # working-directory: libs/sdk-bindings/bindings-python + # run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py + + # - name: Install dependencies + # working-directory: libs/sdk-bindings/bindings-python + # run: pip3 install wheel setuptools + + # - name: Build wheel + # working-directory: libs/sdk-bindings/bindings-python + # run: python3 setup.py bdist_wheel --plat-name macosx_11_0_universal2 --verbose + + # - name: List wheel contents + # working-directory: libs/sdk-bindings/bindings-python/dist + # run: python3 -m zipfile --list *.whl || true + + # - name: Archive the wheel + # uses: actions/upload-artifact@v3 + # with: + # name: python-wheel-${{ matrix.python }}-macos + # path: libs/sdk-bindings/bindings-python/dist/*.whl build-linux-wheels: runs-on: ubuntu-20.04 @@ -120,7 +120,7 @@ jobs: publish-package: runs-on: ubuntu-latest - needs: [build-macos-wheels, build-linux-wheels] + needs: [build-linux-wheels] steps: - name: Checkout breez-sdk repo uses: actions/checkout@v3 From 409e469afd9a8ee1100ab05503ab9dde8038ecac Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:30:11 +0100 Subject: [PATCH 11/14] Revert "Remove macos build for testing" This reverts commit 589e95699ec50da1ffca6407d6d825a28a9b9954. --- .github/workflows/publish-all-platforms.yml | 4 +- .github/workflows/publish-python.yml | 108 ++++++++++---------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/publish-all-platforms.yml b/.github/workflows/publish-all-platforms.yml index 28187084f..58931edc9 100644 --- a/.github/workflows/publish-all-platforms.yml +++ b/.github/workflows/publish-all-platforms.yml @@ -78,7 +78,7 @@ jobs: # to set these variables here to `true` or `false` # (e.g. bindings-windows: true) if you want to test something. bindings-windows: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} - bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version }} + bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }} bindings-linux: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version}} bindings-android: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.flutter-package-version }} bindings-ios: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version }} @@ -240,7 +240,7 @@ jobs: publish-python: needs: - setup - # - build-bindings-darwin + - build-bindings-darwin - build-bindings-linux - build-language-bindings if: ${{ needs.setup.outputs.python == 'true' }} diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 47e4b1df0..04315ed65 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -21,59 +21,59 @@ on: required: true jobs: - # build-macos-wheels: - # runs-on: macos-latest - # strategy: - # matrix: - # python: ["3.8", "3.9", "3.10"] - # steps: - # - name: Checkout breez-sdk repo - # uses: actions/checkout@v3 - # with: - # ref: ${{ inputs.ref || github.sha }} - - # - name: "Install Python" - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python }} - - # - uses: actions/download-artifact@v3 - # with: - # name: sdk-bindings-darwin-universal - # path: libs/sdk-bindings/bindings-python/src/breez_sdk - - # - uses: actions/download-artifact@v3 - # with: - # name: bindings-python - # path: libs/sdk-bindings/bindings-python/src/breez_sdk - - # - name: Clean up downloaded files - # run: | - # rm -f libs/sdk-bindings/bindings-python/src/breez_sdk/*.a - # ls -R libs/sdk-bindings/bindings-python - - # - name: Update package version - # if: ${{ inputs.package-version }} - # working-directory: libs/sdk-bindings/bindings-python - # run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py - - # - name: Install dependencies - # working-directory: libs/sdk-bindings/bindings-python - # run: pip3 install wheel setuptools - - # - name: Build wheel - # working-directory: libs/sdk-bindings/bindings-python - # run: python3 setup.py bdist_wheel --plat-name macosx_11_0_universal2 --verbose - - # - name: List wheel contents - # working-directory: libs/sdk-bindings/bindings-python/dist - # run: python3 -m zipfile --list *.whl || true - - # - name: Archive the wheel - # uses: actions/upload-artifact@v3 - # with: - # name: python-wheel-${{ matrix.python }}-macos - # path: libs/sdk-bindings/bindings-python/dist/*.whl + build-macos-wheels: + runs-on: macos-latest + strategy: + matrix: + python: ["3.8", "3.9", "3.10"] + steps: + - name: Checkout breez-sdk repo + uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref || github.sha }} + + - name: "Install Python" + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-darwin-universal + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - uses: actions/download-artifact@v3 + with: + name: bindings-python + path: libs/sdk-bindings/bindings-python/src/breez_sdk + + - name: Clean up downloaded files + run: | + rm -f libs/sdk-bindings/bindings-python/src/breez_sdk/*.a + ls -R libs/sdk-bindings/bindings-python + + - name: Update package version + if: ${{ inputs.package-version }} + working-directory: libs/sdk-bindings/bindings-python + run: sed -i.bak -e 's/ version=".*",/ version="${{ inputs.package-version }}",/' setup.py + + - name: Install dependencies + working-directory: libs/sdk-bindings/bindings-python + run: pip3 install wheel setuptools + + - name: Build wheel + working-directory: libs/sdk-bindings/bindings-python + run: python3 setup.py bdist_wheel --plat-name macosx_11_0_universal2 --verbose + + - name: List wheel contents + working-directory: libs/sdk-bindings/bindings-python/dist + run: python3 -m zipfile --list *.whl || true + + - name: Archive the wheel + uses: actions/upload-artifact@v3 + with: + name: python-wheel-${{ matrix.python }}-macos + path: libs/sdk-bindings/bindings-python/dist/*.whl build-linux-wheels: runs-on: ubuntu-20.04 @@ -120,7 +120,7 @@ jobs: publish-package: runs-on: ubuntu-latest - needs: [build-linux-wheels] + needs: [build-macos-wheels, build-linux-wheels] steps: - name: Checkout breez-sdk repo uses: actions/checkout@v3 From 1b42d23560910d889ca248a4f063b528f6c5e20c Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Mon, 6 Nov 2023 23:05:10 +0100 Subject: [PATCH 12/14] Test publish --- .github/workflows/publish-python.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 04315ed65..0a1cbf277 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -139,20 +139,20 @@ jobs: ls -laR dist # for developing, testing, and experimenting - # - name: "Publish on test PyPI" - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # verbose: true - # user: __token__ - # password: ${{ secrets.PYPI_API_TOKEN }} - # repository_url: https://test.pypi.org/legacy/ - # packages_dir: libs/sdk-bindings/bindings-python/dist/*/ - - - name: "Publish on PyPI" - if: ${{ inputs.publish }} + - name: "Publish on test PyPI" uses: pypa/gh-action-pypi-publish@release/v1 with: verbose: true user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ packages_dir: libs/sdk-bindings/bindings-python/dist/*/ + + # - name: "Publish on PyPI" + # if: ${{ inputs.publish }} + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # verbose: true + # user: __token__ + # password: ${{ secrets.PYPI_API_TOKEN }} + # packages_dir: libs/sdk-bindings/bindings-python/dist/*/ From 0a47d53d340e316f1c0bafef314078395ea30338 Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Mon, 6 Nov 2023 23:09:14 +0100 Subject: [PATCH 13/14] Revert "Test publish" This reverts commit 1b42d23560910d889ca248a4f063b528f6c5e20c. --- .github/workflows/publish-python.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-python.yml b/.github/workflows/publish-python.yml index 0a1cbf277..04315ed65 100644 --- a/.github/workflows/publish-python.yml +++ b/.github/workflows/publish-python.yml @@ -139,20 +139,20 @@ jobs: ls -laR dist # for developing, testing, and experimenting - - name: "Publish on test PyPI" - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - packages_dir: libs/sdk-bindings/bindings-python/dist/*/ - - # - name: "Publish on PyPI" - # if: ${{ inputs.publish }} + # - name: "Publish on test PyPI" # uses: pypa/gh-action-pypi-publish@release/v1 # with: # verbose: true # user: __token__ # password: ${{ secrets.PYPI_API_TOKEN }} + # repository_url: https://test.pypi.org/legacy/ # packages_dir: libs/sdk-bindings/bindings-python/dist/*/ + + - name: "Publish on PyPI" + if: ${{ inputs.publish }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: libs/sdk-bindings/bindings-python/dist/*/ From 9cdea22d9d42dc0d0ec72218879e4b078c52fd0c Mon Sep 17 00:00:00 2001 From: cnixbtc <111755602+cnixbtc@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:38:01 +0100 Subject: [PATCH 14/14] Alternative workflow input --- .github/workflows/publish-all-platforms.yml | 65 ++++++++------------- 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/.github/workflows/publish-all-platforms.yml b/.github/workflows/publish-all-platforms.yml index 2f0ffca75..735160cf9 100644 --- a/.github/workflows/publish-all-platforms.yml +++ b/.github/workflows/publish-all-platforms.yml @@ -6,38 +6,19 @@ on: description: 'commit/tag/branch reference' required: true type: string - csharp-package-version: - description: 'version for the C# nuget package (MAJOR.MINOR.BUILD)' - required: false + package-version: + description: 'version for the published package(s) (MAJOR.MINOR.BUILD)' + required: true + type: string + packages-to-publish: + description: 'array of packages to publish (remove what you do not want)' + required: true type: string + default: '["csharp", "golang", "maven", "kotlin-mpp", "flutter", "react-native", "python"]' csharp-ref: description: 'optional commit/tag/branch reference for the C# project. Defaults to ref.' required: false type: string - golang-package-version: - description: 'version for the golang package (MAJOR.MINOR.BUILD) (no v prefix)' - required: false - type: string - maven-package-version: - description: 'version for the android package (MAJOR.MINOR.BUILD)' - required: false - type: string - kotlin-mpp-package-version: - description: 'version for the kotlin multiplatform package (MAJOR.MINOR.BUILD)' - required: false - type: string - flutter-package-version: - description: 'version for the flutter package (MAJOR.MINOR.BUILD) (no v prefix)' - required: false - type: string - react-native-package-version: - description: 'version for the react native package (MAJOR.MINOR.BUILD)' - required: false - type: string - python-package-version: - description: 'version for the python package (MAJOR.MINOR.BUILD)' - required: false - type: string use-dummy-binaries: description: 'boolean indicating whether to use dummies for the sdk binaries. Default = false.' required: false @@ -86,6 +67,10 @@ on: description: 'version for the react native package (MAJOR.MINOR.BUILD)' required: false type: string + python-package-version: + description: 'version for the python package (MAJOR.MINOR.BUILD)' + required: false + type: string use-dummy-binaries: description: 'boolean indicating whether to use dummies for the sdk binaries. Default = false.' required: false @@ -104,14 +89,14 @@ jobs: # certain inputs. repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - csharp-package-version: ${{ inputs.csharp-package-version }} + csharp-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'csharp') && inputs.package-version) || '' }} csharp-ref: ${{ inputs.csharp-ref || inputs.ref || github.sha }} - golang-package-version: ${{ inputs.golang-package-version }} - maven-package-version: ${{ inputs.maven-package-version }} - kotlin-mpp-package-version: ${{ inputs.kotlin-mpp-package-version }} - flutter-package-version: ${{ inputs.flutter-package-version }} - react-native-package-version: ${{ inputs.react-native-package-version }} - python-package-version: ${{ inputs.python-package-version }} + golang-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'golang') && inputs.package-version) || '' }} + maven-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'maven') && inputs.package-version) || ''}} + kotlin-mpp-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'kotlin-mpp') && inputs.package-version) || '' }} + flutter-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'flutter') && inputs.package-version) || '' }} + react-native-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'react-native') && inputs.package-version) || '' }} + python-package-version: ${{ (contains(fromJSON(inputs.packages-to-publish), 'python') && inputs.package-version) || '' }} use-dummy-binaries: ${{ inputs.use-dummy-binaries }} publish: ${{ inputs.publish }} steps: @@ -210,7 +195,7 @@ jobs: swift: ${{ needs.setup.outputs.swift == 'true'}} publish-csharp: - needs: + needs: - setup - build-bindings-windows - build-bindings-darwin @@ -228,7 +213,7 @@ jobs: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} publish-golang: - needs: + needs: - setup - build-bindings-android - build-bindings-windows @@ -245,7 +230,7 @@ jobs: REPO_SSH_KEY: ${{ secrets.REPO_SSH_KEY }} publish-maven: - needs: + needs: - setup - build-bindings-android - build-language-bindings @@ -261,7 +246,7 @@ jobs: BREEZ_MVN_PASSWORD: ${{ secrets.BREEZ_MVN_PASSWORD }} publish-kotlin-mpp: - needs: + needs: - setup - build-bindings-android - build-bindings-ios @@ -278,9 +263,9 @@ jobs: BREEZ_MVN_PASSWORD: ${{ secrets.BREEZ_MVN_PASSWORD }} publish-flutter: - needs: + needs: - setup - - build-bindings-android + - build-bindings-android if: ${{ needs.setup.outputs.flutter == 'true' }} uses: ./.github/workflows/publish-flutter.yml with: