Skip to content

last round

last round #16

Workflow file for this run

name: Publish C# Bindings
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
package-version:
description: 'version for the nuget package (MAJOR.MINOR.BUILD)'
required: true
type: string
push:
branches:
- build-artifacts-in-ci
jobs:
build-all-platforms:
name: Build all platforms
uses: ./.github/workflows/build-all-platforms.yml
with:
ref: ${{ inputs.ref || github.sha }}
build-package:
needs: build-all-platforms
runs-on: ubuntu-latest
steps:
- name: Checkout breez-sdk repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref || github.sha }}
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
cargo install uniffi-bindgen-cs --git https://github.com/breez/uniffi-bindgen-cs --branch namespace
- name: Build C# binding
working-directory: libs/sdk-bindings
run: |
uniffi-bindgen-cs src/breez_sdk.udl -o bindings-csharp/src -c ./uniffi.toml
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-aarch64-apple-darwin
path: libs/sdk-bindings/bindings-csharp/src/runtimes/osx-arm64/native
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-x86_64-apple-darwin
path: libs/sdk-bindings/bindings-csharp/src/runtimes/osx-x64/native
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-aarch64-unknown-linux-gnu
path: libs/sdk-bindings/bindings-csharp/src/runtimes/linux-arm64/native
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-x86_64-unknown-linux-gnu
path: libs/sdk-bindings/bindings-csharp/src/runtimes/linux-x64/native
- uses: actions/download-artifact@v3
with:
name: sdk-bindings-x86_64-pc-windows-msvc
path: libs/sdk-bindings/bindings-csharp/src/runtimes/win-x64/native
- name: Update package version
if: ${{ inputs.package-version }}
working-directory: libs/sdk-bindings/bindings-csharp/src
run: sed -i.bak -e 's/<Version>.*<\/Version>/<Version>${{ inputs.package-version }}<\/Version>/' Breez.Sdk.csproj
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build the project
working-directory: libs/sdk-bindings/bindings-csharp/src
run: dotnet build Breez.Sdk.csproj
- name: Create the package
working-directory: libs/sdk-bindings/bindings-csharp/src
run: dotnet pack --configuration Release Breez.Sdk.csproj
- name: Archive the package
uses: actions/upload-artifact@v3
with:
name: Breez.Sdk.${{ inputs.package-version || '0.0.1' }}.nupkg
path: libs/sdk-bindings/bindings-csharp/src/bin/Release/Breez.Sdk.*.nupkg
test-package:
needs: build-package
runs-on: ${{ matrix.target }}
strategy:
matrix:
target: [
windows-latest,
ubuntu-latest,
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: Breez.Sdk.${{ inputs.package-version || '0.0.1' }}.nupkg
path: libs/sdk-bindings/bindings-csharp/src/bin/Release
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: test package
working-directory: libs/sdk-bindings/tests/bindings/csharp
run: dotnet run