-
Notifications
You must be signed in to change notification settings - Fork 43
290 lines (279 loc) · 12.8 KB
/
publish-all-platforms.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
name: Publish all packages
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
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
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
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
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:
name: Pre-setup
runs-on: ubuntu-latest
outputs:
# These outputs mimic the inputs for the workflow.
# Their only purpose is to be able to test this workflow if you make
# 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: ${{ (contains(fromJSON(inputs.packages-to-publish), 'csharp') && inputs.package-version) || '' }}
csharp-ref: ${{ inputs.csharp-ref || inputs.ref || github.sha }}
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:
- run: echo "set pre-setup output variables"
setup:
name: Setup
needs: pre-setup
runs-on: ubuntu-latest
outputs:
# Careful, a boolean input is not a boolean output. A boolean input is
# actually a boolean, but these outputs are strings. All the boolean
# 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 || !!needs.pre-setup.outputs.python-package-version }}
bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }}
bindings-linux: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }}
bindings-android: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.golang-package-version }}
bindings-ios: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version }}
kotlin: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.flutter-package-version }}
swift: ${{ !!needs.pre-setup.outputs.flutter-package-version }}
python: ${{ !!needs.pre-setup.outputs.python-package-version }}
csharp: ${{ !!needs.pre-setup.outputs.csharp-package-version }}
golang: ${{ !!needs.pre-setup.outputs.golang-package-version }}
maven: ${{ !!needs.pre-setup.outputs.maven-package-version }}
kotlin-mpp: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version }}
flutter: ${{ !!needs.pre-setup.outputs.flutter-package-version }}
react-native: ${{ !!needs.pre-setup.outputs.react-native-package-version }}
ref: ${{ needs.pre-setup.outputs.ref }}
csharp-package-version: ${{ needs.pre-setup.outputs.csharp-package-version || '0.0.2' }}
csharp-ref: ${{ needs.pre-setup.outputs.csharp-ref }}
golang-package-version: ${{ needs.pre-setup.outputs.golang-package-version || '0.0.2' }}
maven-package-version: ${{ needs.pre-setup.outputs.maven-package-version || '0.0.2' }}
kotlin-mpp-package-version: ${{ needs.pre-setup.outputs.kotlin-mpp-package-version || '0.0.2' }}
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' }}
python-package-version: ${{ needs.pre-setup.outputs.python-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"
build-bindings-windows:
needs: setup
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'}}
golang: ${{ needs.setup.outputs.golang == 'true'}}
python: ${{ needs.setup.outputs.python == 'true'}}
swift: ${{ needs.setup.outputs.swift == 'true'}}
publish-csharp:
needs:
- setup
- build-bindings-windows
- build-bindings-darwin
- build-bindings-linux
- build-language-bindings
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: true
secrets:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
publish-golang:
needs:
- setup
- build-bindings-android
- build-bindings-windows
- build-bindings-darwin
- build-bindings-linux
- build-language-bindings
if: ${{ needs.setup.outputs.golang == 'true' }}
uses: ./.github/workflows/publish-golang.yml
with:
ref: ${{ needs.setup.outputs.ref }}
package-version: ${{ needs.setup.outputs.golang-package-version }}
publish: ${{ needs.setup.outputs.publish == 'true' }}
secrets:
REPO_SSH_KEY: ${{ secrets.REPO_SSH_KEY }}
publish-maven:
needs:
- setup
- build-bindings-android
- build-language-bindings
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' }}
secrets:
BREEZ_MVN_USERNAME: ${{ secrets.BREEZ_MVN_USERNAME }}
BREEZ_MVN_PASSWORD: ${{ secrets.BREEZ_MVN_PASSWORD }}
publish-kotlin-mpp:
needs:
- setup
- build-bindings-android
- build-bindings-ios
- build-language-bindings
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' }}
secrets:
BREEZ_MVN_USERNAME: ${{ secrets.BREEZ_MVN_USERNAME }}
BREEZ_MVN_PASSWORD: ${{ secrets.BREEZ_MVN_PASSWORD }}
publish-flutter:
needs:
- setup
- build-language-bindings
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' }}
secrets:
REPO_SSH_KEY: ${{ secrets.REPO_SSH_KEY }}
# react native version x.y.z will at runtime require
# ios and android packages x.y.z being published already.
publish-react-native:
needs:
- setup
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' }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-python:
needs:
- setup
- build-bindings-darwin
- build-bindings-linux
- build-bindings-windows
- build-language-bindings
if: ${{ needs.setup.outputs.python == 'true' }}
uses: ./.github/workflows/publish-python.yml
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
package-version: ${{ needs.setup.outputs.python-package-version }}
publish: ${{ needs.setup.outputs.publish == 'true' }}
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}