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] 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: