diff --git a/.github/workflows/build-bindings-android.yml b/.github/workflows/build-bindings-android.yml index 9b457cfee..c60252ba6 100644 --- a/.github/workflows/build-bindings-android.yml +++ b/.github/workflows/build-bindings-android.yml @@ -8,13 +8,23 @@ on: type: string 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 + use-dummy-binaries: + description: 'If true, creates dummy binaries rather than real binaries' + required: false + type: boolean + default: false jobs: build: + if: ${{ !inputs.use-dummy-binaries }} runs-on: ubuntu-latest name: build ${{ matrix.target }} strategy: @@ -30,6 +40,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.ref }} + repository: ${{ inputs.repository || github.repository }} - name: Install rust toolchain run: | @@ -102,3 +113,58 @@ jobs: with: name: sdk-bindings-android-jniLibs path: ./* + + build-dummies: + if: ${{ inputs.use-dummy-binaries }} + runs-on: ubuntu-latest + name: build android dummies + strategy: + matrix: + target: [ + aarch64-linux-android, + armv7-linux-androideabi, + i686-linux-android, + x86_64-linux-android, + ] + steps: + - name: Build Android ${{ matrix.target }} dummy + run: | + touch libbreez_sdk_bindings.so + touch libc++_shared.so.so + + - name: Upload dummy Android ${{ matrix.target }} artifact + uses: actions/upload-artifact@v3 + with: + name: sdk-bindings-${{ matrix.target }} + path: ./* + + jnilibs-dummy: + needs: build-dummies + runs-on: ubuntu-latest + name: build jniLibs dummy + steps: + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-aarch64-linux-android + path: arm64-v8a + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-armv7-linux-androideabi + path: armeabi-v7a + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-i686-linux-android + path: x86 + + - uses: actions/download-artifact@v3 + with: + name: sdk-bindings-x86_64-linux-android + path: x86_64 + + - name: Archive jniLibs + uses: actions/upload-artifact@v3 + with: + name: sdk-bindings-android-jniLibs + path: ./* \ No newline at end of file diff --git a/.github/workflows/build-bindings-darwin.yml b/.github/workflows/build-bindings-darwin.yml index 65d9029e3..9a56ffe8b 100644 --- a/.github/workflows/build-bindings-darwin.yml +++ b/.github/workflows/build-bindings-darwin.yml @@ -8,13 +8,23 @@ on: type: string 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 + use-dummy-binaries: + description: 'If true, creates dummy binaries rather than real binaries' + required: false + type: boolean + default: false jobs: build: + if: ${{ !inputs.use-dummy-binaries }} runs-on: macOS-latest name: build ${{ matrix.target }} strategy: @@ -28,6 +38,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.ref }} + repository: ${{ inputs.repository || github.repository }} - name: Install rust toolchain run: | @@ -86,3 +97,26 @@ jobs: path: | darwin-universal/libbreez_sdk_bindings.dylib darwin-universal/libbreez_sdk_bindings.a + + build-dummies: + if: ${{ inputs.use-dummy-binaries }} + runs-on: ubuntu-latest + name: build darwin dummies + strategy: + matrix: + target: [ + aarch64-apple-darwin, + x86_64-apple-darwin, + darwin-universal + ] + steps: + - name: Build dummy darwin ${{ matrix.target }} + run: | + touch libbreez_sdk_bindings.dylib + touch libbreez_sdk_bindings.a + + - name: Upload dummy darwin ${{ matrix.target }} artifact + uses: actions/upload-artifact@v3 + with: + name: sdk-bindings-${{ matrix.target }} + path: ./* \ No newline at end of file diff --git a/.github/workflows/build-bindings-ios.yml b/.github/workflows/build-bindings-ios.yml index 5cb289a3a..b408e62f5 100644 --- a/.github/workflows/build-bindings-ios.yml +++ b/.github/workflows/build-bindings-ios.yml @@ -8,13 +8,23 @@ on: type: string 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 + use-dummy-binaries: + description: 'If true, creates dummy binaries rather than real binaries' + required: false + type: boolean + default: false jobs: build: + if: ${{ !inputs.use-dummy-binaries }} runs-on: macOS-latest name: build ${{ matrix.target }} strategy: @@ -29,6 +39,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.ref }} + repository: ${{ inputs.repository || github.repository }} - name: Install rust toolchain run: | @@ -60,3 +71,25 @@ jobs: with: name: sdk-bindings-${{ matrix.target }} path: libs/target/${{ matrix.target }}/release/libbreez_sdk_bindings.a + + build-dummies: + if: ${{ inputs.use-dummy-binaries }} + runs-on: ubuntu-latest + name: build ios dummies + strategy: + matrix: + target: [ + aarch64-apple-ios, + x86_64-apple-ios, + aarch64-apple-ios-sim, + ] + steps: + - name: Build dummy ios ${{ matrix.target }} + run: | + touch libbreez_sdk_bindings.a + + - name: Upload dummy ios ${{ matrix.target }} artifact + uses: actions/upload-artifact@v3 + with: + name: sdk-bindings-${{ matrix.target }} + path: ./* diff --git a/.github/workflows/build-bindings-linux.yml b/.github/workflows/build-bindings-linux.yml index 7024d4804..2dcd16f94 100644 --- a/.github/workflows/build-bindings-linux.yml +++ b/.github/workflows/build-bindings-linux.yml @@ -8,13 +8,23 @@ on: type: string 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 + use-dummy-binaries: + description: 'If true, creates dummy binaries rather than real binaries' + required: false + type: boolean + default: false jobs: build: + if: ${{ !inputs.use-dummy-binaries }} runs-on: ubuntu-20.04 name: build ${{ matrix.target }} strategy: @@ -28,6 +38,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.ref }} + repository: ${{ inputs.repository || github.repository }} - name: Install rust toolchain run: | @@ -69,3 +80,24 @@ jobs: with: name: sdk-bindings-${{ matrix.target }} path: libs/target/${{ matrix.target }}/release/libbreez_sdk_bindings.so + + build-dummies: + if: ${{ inputs.use-dummy-binaries }} + runs-on: ubuntu-latest + name: build linux dummies + strategy: + matrix: + target: [ + aarch64-unknown-linux-gnu, + x86_64-unknown-linux-gnu, + ] + steps: + - name: Build dummy linux ${{ matrix.target }} + run: | + touch libbreez_sdk_bindings.so + + - name: Upload dummy linux ${{ matrix.target }} artifact + uses: actions/upload-artifact@v3 + with: + name: sdk-bindings-${{ matrix.target }} + path: ./* \ No newline at end of file diff --git a/.github/workflows/build-bindings-windows.yml b/.github/workflows/build-bindings-windows.yml index 91d916231..7354c8467 100644 --- a/.github/workflows/build-bindings-windows.yml +++ b/.github/workflows/build-bindings-windows.yml @@ -8,13 +8,23 @@ on: type: string 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 + use-dummy-binaries: + description: 'If true, creates dummy binaries rather than real binaries' + required: false + type: boolean + default: false jobs: build: + if: ${{ !inputs.use-dummy-binaries }} runs-on: windows-latest name: build ${{ matrix.target }} strategy: @@ -28,6 +38,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.ref }} + repository: ${{ inputs.repository || github.repository }} - name: Install rust toolchain run: | @@ -54,3 +65,24 @@ jobs: with: name: sdk-bindings-${{ matrix.target }} path: libs/target/${{ matrix.target }}/release/breez_sdk_bindings.dll + + build-dummies: + if: ${{ inputs.use-dummy-binaries }} + runs-on: ubuntu-latest + name: build windows dummies + strategy: + matrix: + target: [ + x86_64-pc-windows-msvc, + i686-pc-windows-msvc, + ] + steps: + - name: Build dummy windows ${{ matrix.target }} + run: | + touch breez_sdk_bindings.dll + + - name: Upload dummy windows ${{ matrix.target }} artifact + uses: actions/upload-artifact@v3 + with: + name: sdk-bindings-${{ matrix.target }} + path: ./* \ No newline at end of file diff --git a/.github/workflows/build-language-bindings.yml b/.github/workflows/build-language-bindings.yml index bbf7cd423..a34afc8c5 100644 --- a/.github/workflows/build-language-bindings.yml +++ b/.github/workflows/build-language-bindings.yml @@ -28,6 +28,10 @@ on: 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 @@ -60,6 +64,7 @@ jobs: - name: Checkout breez-sdk repo uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - name: Install rust diff --git a/.github/workflows/publish-all-platforms.yml b/.github/workflows/publish-all-platforms.yml index 03258c463..a6f956496 100644 --- a/.github/workflows/publish-all-platforms.yml +++ b/.github/workflows/publish-all-platforms.yml @@ -34,11 +34,59 @@ on: description: 'version for the react native 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 + type: boolean + default: false publish: description: 'boolean indicating whether packages should be published. true to publish. false to build only. Default = false.' 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 + csharp-package-version: + description: 'version for the C# nuget package (MAJOR.MINOR.BUILD)' + required: false + type: string + 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 + use-dummy-binaries: + description: 'boolean indicating whether to use dummies for the sdk binaries. Default = false.' + required: false + type: boolean + default: false jobs: pre-setup: @@ -50,6 +98,7 @@ jobs: # changes that you won't want to commit to main yet. # You can set these values manually, to test how the CI behaves with # certain inputs. + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} csharp-package-version: ${{ inputs.csharp-package-version }} csharp-ref: ${{ inputs.csharp-ref || inputs.ref || github.sha }} @@ -58,6 +107,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 }} + use-dummy-binaries: ${{ inputs.use-dummy-binaries }} publish: ${{ inputs.publish }} steps: - run: echo "set pre-setup output variables" @@ -72,6 +122,7 @@ jobs: # checks in this file have the format `boolean == 'true'`. So feel free # to set these variables here to `true` or `false` # (e.g. bindings-windows: true) if you want to test something. + repository: ${{ needs.pre-setup.outputs.repository }} 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 }} @@ -95,6 +146,7 @@ jobs: 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' }} publish: ${{ needs.pre-setup.outputs.publish }} + use-dummy-binaries: ${{ needs.pre-setup.outputs.use-dummy-binaries }} steps: - run: echo "set setup output variables" @@ -103,36 +155,47 @@ jobs: if: ${{ needs.setup.outputs.bindings-windows == 'true' }} uses: ./.github/workflows/build-bindings-windows.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} + use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }} build-bindings-darwin: needs: setup if: ${{ needs.setup.outputs.bindings-darwin == 'true' }} uses: ./.github/workflows/build-bindings-darwin.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} + use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }} build-bindings-linux: needs: setup if: ${{ needs.setup.outputs.bindings-linux == 'true' }} uses: ./.github/workflows/build-bindings-linux.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} + use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }} build-bindings-android: needs: setup if: ${{ needs.setup.outputs.bindings-android == 'true' }} uses: ./.github/workflows/build-bindings-android.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} + use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }} build-bindings-ios: needs: setup if: ${{ needs.setup.outputs.bindings-ios == 'true' }} uses: ./.github/workflows/build-bindings-ios.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} + use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }} build-language-bindings: needs: setup uses: ./.github/workflows/build-language-bindings.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} kotlin: ${{ needs.setup.outputs.kotlin == 'true'}} csharp: ${{ needs.setup.outputs.csharp == 'true'}} @@ -150,9 +213,11 @@ jobs: if: ${{ needs.setup.outputs.csharp == 'true' }} uses: ./.github/workflows/publish-csharp.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.csharp-ref }} package-version: ${{ needs.setup.outputs.csharp-package-version }} publish: ${{ needs.setup.outputs.publish == 'true' }} + skip-tests: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }} secrets: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} @@ -181,6 +246,7 @@ jobs: if: ${{ needs.setup.outputs.maven == 'true' }} uses: ./.github/workflows/publish-android.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} package-version: ${{ needs.setup.outputs.maven-package-version }} publish: ${{ needs.setup.outputs.publish == 'true' }} @@ -197,6 +263,7 @@ jobs: if: ${{ needs.setup.outputs.kotlin-mpp == 'true' }} uses: ./.github/workflows/publish-kotlin-mpp.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} package-version: ${{ needs.setup.outputs.kotlin-mpp-package-version }} publish: ${{ needs.setup.outputs.publish == 'true' }} @@ -211,6 +278,7 @@ jobs: if: ${{ needs.setup.outputs.flutter == 'true' }} uses: ./.github/workflows/publish-flutter.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} package-version: ${{ needs.setup.outputs.flutter-package-version }} publish: ${{ needs.setup.outputs.publish == 'true' }} @@ -225,6 +293,7 @@ jobs: if: ${{ needs.setup.outputs.react-native == 'true' }} uses: ./.github/workflows/publish-react-native.yml with: + repository: ${{ needs.setup.outputs.repository }} ref: ${{ needs.setup.outputs.ref }} package-version: ${{ needs.setup.outputs.react-native-package-version }} publish: ${{ needs.setup.outputs.publish == 'true' }} diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 5f6e11d99..3b45bf9c4 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -2,6 +2,10 @@ name: Publish Android Bindings on: workflow_call: inputs: + repository: + description: 'sdk repository, defaults to current repository' + required: false + type: string ref: description: 'commit/tag/branch reference' required: true @@ -30,6 +34,7 @@ jobs: - name: Checkout breez-sdk repo uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - uses: actions/download-artifact@v3 diff --git a/.github/workflows/publish-csharp.yml b/.github/workflows/publish-csharp.yml index babaad38d..086f4ccf6 100644 --- a/.github/workflows/publish-csharp.yml +++ b/.github/workflows/publish-csharp.yml @@ -2,6 +2,10 @@ name: Publish C# Bindings on: workflow_call: inputs: + repository: + description: 'sdk repository, defaults to current repository' + required: false + type: string ref: description: 'commit/tag/branch reference' required: true @@ -10,6 +14,11 @@ on: description: 'version for the nuget package (MAJOR.MINOR.BUILD)' required: true type: string + skip-tests: + description: 'value indicating whether to skip the tests' + required: false + default: false + type: boolean publish: description: 'value indicating whether to publish to nuget.' required: true @@ -27,6 +36,7 @@ jobs: - name: Checkout breez-sdk repo uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - uses: actions/download-artifact@v3 @@ -101,21 +111,26 @@ jobs: ] steps: - name: Checkout breez-sdk repo + if: ${{ !inputs.skip-tests }} uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - uses: actions/download-artifact@v3 + if: ${{ !inputs.skip-tests }} with: name: Breez.Sdk.${{ inputs.package-version || '0.0.1' }}.nupkg path: libs/sdk-bindings/bindings-csharp/src/bin/Release - name: Setup dotnet + if: ${{ !inputs.skip-tests }} uses: actions/setup-dotnet@v3 with: dotnet-version: '7.0.x' - name: test package + if: ${{ !inputs.skip-tests }} working-directory: libs/sdk-bindings/bindings-csharp/test run: dotnet run diff --git a/.github/workflows/publish-flutter.yml b/.github/workflows/publish-flutter.yml index 14d6f5b3c..3750910cf 100644 --- a/.github/workflows/publish-flutter.yml +++ b/.github/workflows/publish-flutter.yml @@ -2,6 +2,10 @@ name: Publish Flutter Package on: workflow_call: inputs: + repository: + description: 'sdk repository, defaults to current repository' + required: false + type: string ref: description: 'commit/tag/branch reference' required: true @@ -35,6 +39,7 @@ jobs: - name: Checkout breez-sdk repo uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} path: breez-sdk diff --git a/.github/workflows/publish-kotlin-mpp.yml b/.github/workflows/publish-kotlin-mpp.yml index 9726a45eb..6ced0e9f5 100644 --- a/.github/workflows/publish-kotlin-mpp.yml +++ b/.github/workflows/publish-kotlin-mpp.yml @@ -2,6 +2,10 @@ name: Publish Kotlin multiplatform Bindings on: workflow_call: inputs: + repository: + description: 'sdk repository, defaults to current repository' + required: false + type: string ref: description: 'commit/tag/branch reference' required: true @@ -30,6 +34,7 @@ jobs: - name: Checkout breez-sdk repo uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - uses: actions/setup-java@v3 diff --git a/.github/workflows/publish-react-native.yml b/.github/workflows/publish-react-native.yml index 0d97aed1e..85c5a55d8 100644 --- a/.github/workflows/publish-react-native.yml +++ b/.github/workflows/publish-react-native.yml @@ -2,6 +2,10 @@ name: Publish React Native Plugin on: workflow_call: inputs: + repository: + description: 'sdk repository, defaults to current repository' + required: false + type: string ref: description: 'commit/tag/branch reference' required: true @@ -27,6 +31,7 @@ jobs: - name: Checkout breez-sdk repo uses: actions/checkout@v3 with: + repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref || github.sha }} - name: Setup node