-
Notifications
You must be signed in to change notification settings - Fork 43
232 lines (222 loc) · 9.52 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
name: Publish all packages
on:
workflow_dispatch:
inputs:
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
publish:
description: 'boolean indicating whether packages should be published. true to publish. false to build only. 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.
ref: ${{ inputs.ref || github.sha }}
csharp-package-version: ${{ inputs.csharp-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 }}
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.
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 }}
bindings-android: ${{ !!needs.pre-setup.outputs.kotlin-mpp-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.flutter-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 }}
swift: false
python: false
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' }}
publish: ${{ needs.pre-setup.outputs.publish }}
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:
ref: ${{ needs.setup.outputs.ref }}
build-bindings-darwin:
needs: setup
if: ${{ needs.setup.outputs.bindings-darwin == 'true' }}
uses: ./.github/workflows/build-bindings-darwin.yml
with:
ref: ${{ needs.setup.outputs.ref }}
build-bindings-linux:
needs: setup
if: ${{ needs.setup.outputs.bindings-linux == 'true' }}
uses: ./.github/workflows/build-bindings-linux.yml
with:
ref: ${{ needs.setup.outputs.ref }}
build-bindings-android:
needs: setup
if: ${{ needs.setup.outputs.bindings-android == 'true' }}
uses: ./.github/workflows/build-bindings-android.yml
with:
ref: ${{ needs.setup.outputs.ref }}
build-bindings-ios:
needs: setup
if: ${{ needs.setup.outputs.bindings-ios == 'true' }}
uses: ./.github/workflows/build-bindings-ios.yml
with:
ref: ${{ needs.setup.outputs.ref }}
build-language-bindings:
needs: setup
uses: ./.github/workflows/build-language-bindings.yml
with:
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:
ref: ${{ needs.setup.outputs.csharp-ref }}
package-version: ${{ needs.setup.outputs.csharp-package-version }}
publish: ${{ needs.setup.outputs.publish == '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:
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:
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-bindings-android
if: ${{ needs.setup.outputs.flutter == 'true' }}
uses: ./.github/workflows/publish-flutter.yml
with:
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:
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 }}