-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Publish Python Bindings | ||
on: | ||
workflow_dispatch: | ||
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 nuget.' | ||
required: true | ||
type: boolean | ||
default: false | ||
secrets: | ||
PYPI_API_TOKEN: | ||
description: 'api token to authenticate to pypi' | ||
required: true | ||
|
||
jobs: | ||
build-darwin-wheel: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout breez-sdk repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref || github.sha }} | ||
|
||
- 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: Display structure of downloaded files | ||
run: ls -R 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: python setup.py sdist bdist_wheel | ||
|
||
- name: Archive the wheel | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-darwin-wheel | ||
path: libs/sdk-bindings/bindings-python/dist/*.whl | ||
|
||
publish-package: | ||
runs-on: macos-latest | ||
needs: [build-darwin-wheel] | ||
steps: | ||
- name: Checkout breez-sdk repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref || github.sha }} | ||
|
||
- name: Create dist directory | ||
working-directory: libs/sdk-bindings/bindings-python | ||
run: mkdir -p dist | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: python-darwin-wheel | ||
path: libs/sdk-bindings/bindings-python/dist | ||
|
||
- name: "Publish on test PyPI" | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/ | ||
packages_dir: dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
src/breez_sdk/breez_sdk.py | ||
src/breez_sdk/*.dylib | ||
*.egg-info | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/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", | ||
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 <[email protected]>", | ||
license="MIT", | ||
has_ext_modules=lambda: True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from breez_sdk.breez_sdk import * |