Files
breez-sdk-liquid/.github/workflows/build-language-bindings.yml
Erdem Yerebasmaz 573a345801 Downgrade android release to Uniffi 0.25 (#786)
* fix: revert minSdkVersion across all uniffi packages

This PR fixes a regression introduced in https://github.com/breez/breez-sdk-liquid/pull/766 due to a confusion between minSdkVersion requirement & minimum compileSdkVersion requirement.

* Bump package requirements on flutter_breez_liquid README

* Bump JNA used on bindings tests to 5.14.0

* Downgrade android release to Uniffi 0.25

---------

Co-authored-by: Ross Savage <hello@satimoto.com>
2025-03-19 13:41:44 +03:00

186 lines
5.6 KiB
YAML

name: Build Language bindings
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
kotlin:
required: false
type: boolean
default: false
swift:
required: false
type: boolean
default: false
python:
required: false
type: boolean
default: false
csharp:
required: false
type: boolean
default: false
golang:
required: false
type: boolean
default: false
workflow_call:
inputs:
repository:
description: 'sdk repository, defaults to current repository'
required: false
type: string
ref:
description: 'commit/tag/branch reference'
required: true
type: string
kotlin:
required: false
type: boolean
default: false
swift:
required: false
type: boolean
default: false
python:
required: false
type: boolean
default: false
csharp:
required: false
type: boolean
default: false
golang:
required: false
type: boolean
default: false
jobs:
build-language-bindings:
runs-on: ubuntu-latest
if: ${{ inputs.swift || inputs.python }}
steps:
- name: Checkout breez-sdk-liquid repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: lib
- name: Build Swift binding
if: ${{ inputs.swift }}
working-directory: lib/bindings
run: |
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift --out-dir langs/swift/Sources/BreezSDKLiquid
mv langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquid.swift langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
- name: Archive Swift binding
if: ${{ inputs.swift }}
uses: actions/upload-artifact@v4
with:
name: bindings-swift
path: lib/bindings/langs/swift/Sources/BreezSDKLiquid/*
- name: Build Python binding
if: ${{ inputs.python }}
working-directory: lib/bindings
run: |
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language python -o ffi/python
- name: Archive Python binding
if: ${{ inputs.python }}
uses: actions/upload-artifact@v4
with:
name: bindings-python
path: lib/bindings/ffi/python/breez_sdk_liquid.py
build-language-bindings-uniffi-25:
runs-on: ubuntu-latest
if: ${{ inputs.kotlin || inputs.csharp || inputs.golang }}
steps:
- name: Checkout breez-sdk-liquid repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: uniffi-25
workspaces: lib
- name: Build Kotlin binding
if: ${{ inputs.kotlin }}
working-directory: lib/bindings
run: |
cargo run --no-default-features --features=uniffi-25 --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language kotlin -o ffi/kotlin
- name: Archive Kotlin binding
if: ${{ inputs.kotlin }}
uses: actions/upload-artifact@v4
with:
name: bindings-kotlin
path: lib/bindings/ffi/kotlin/breez_sdk_liquid/breez_sdk_liquid.kt
- name: Archive Kotlin multiplatform binding
if: ${{ inputs.kotlin }}
uses: actions/upload-artifact@v4
with:
name: bindings-kotlin-multiplatform
path: lib/bindings/ffi/kmp/*
- name: Build C# binding
if: ${{ inputs.csharp }}
working-directory: lib/bindings
run: |
cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.8.0+v0.25.0
uniffi-bindgen-cs src/breez_sdk_liquid.udl -o ffi/csharp -c ./uniffi.toml
- name: Archive C# binding
if: ${{ inputs.csharp }}
uses: actions/upload-artifact@v4
with:
name: bindings-csharp
path: lib/bindings/ffi/csharp/breez_sdk_liquid.cs
- name: Build golang binding
if: ${{ inputs.golang }}
working-directory: lib/bindings
run: |
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0
uniffi-bindgen-go src/breez_sdk_liquid.udl -o ffi/golang -c ./uniffi.toml
- name: Archive golang binding
if: ${{ inputs.golang }}
uses: actions/upload-artifact@v4
with:
name: bindings-golang
path: lib/bindings/ffi/golang/breez_sdk_liquid/breez_sdk_liquid.*