55
55
RUN_GEN : ${{ steps.setup.outputs.RUN_GEN }}
56
56
GEN_MATRIX : ${{ steps.setup.outputs.GEN_MATRIX }}
57
57
58
+ RUN_GEN_JAVASCRIPT : ${{ steps.setup.outputs.RUN_GEN_JAVASCRIPT }}
59
+ RUN_GEN_JAVA : ${{ steps.setup.outputs.RUN_GEN_JAVA }}
60
+ RUN_GEN_PHP : ${{ steps.setup.outputs.RUN_GEN_PHP }}
61
+
58
62
RUN_JS_ALGOLIASEARCH : ${{ steps.setup.outputs.RUN_JS_ALGOLIASEARCH }}
59
63
RUN_JS_UTILS : ${{ steps.setup.outputs.RUN_JS_UTILS }}
60
64
RUN_JS_TESTS : ${{ steps.setup.outputs.RUN_JS_TESTS }}
@@ -189,13 +193,6 @@ jobs:
189
193
key : ${{ matrix.client.cacheKey }}
190
194
path : ${{ matrix.client.path }}
191
195
192
- - name : Download bundled specs
193
- if : ${{ steps.cache.outputs.cache-hit != 'true' }}
194
- uses : actions/download-artifact@v3
195
- with :
196
- name : specs
197
- path : specs/bundled/
198
-
199
196
- name : Download specs artifacts
200
197
if : ${{ steps.cache.outputs.cache-hit != 'true' }}
201
198
uses : ./.github/actions/restore-artifacts
@@ -206,7 +203,7 @@ jobs:
206
203
if : ${{ matrix.client.language == 'javascript' && steps.cache.outputs.cache-hit != 'true' }}
207
204
uses : ./.github/actions/restore-artifacts
208
205
with :
209
- type : utils
206
+ type : js_utils
210
207
211
208
- name : Setup
212
209
uses : ./.github/actions/setup
@@ -284,15 +281,14 @@ jobs:
284
281
if : ${{ steps.cache.outputs.cache-hit != 'true' }}
285
282
run : yarn cli build clients javascript algoliasearch
286
283
287
- codegen_on_pr :
284
+ codegen :
288
285
runs-on : ubuntu-20.04
289
286
timeout-minutes : 10
290
287
needs :
291
288
- setup
292
289
- client_gen
293
290
if : |
294
291
always() &&
295
- github.event_name == 'pull_request' &&
296
292
!contains(needs.*.result, 'cancelled') &&
297
293
!contains(needs.*.result, 'failure')
298
294
steps :
@@ -312,51 +308,20 @@ jobs:
312
308
uses : ./.github/actions/restore-artifacts
313
309
with :
314
310
type : all
311
+ javascript : ${{ needs.setup.outputs.RUN_GEN_JAVASCRIPT }}
312
+ php : ${{ needs.setup.outputs.RUN_GEN_PHP }}
313
+ java : ${{ needs.setup.outputs.RUN_GEN_JAVA }}
315
314
316
- - name : Push generated code to generated branch
315
+ - name : Push generated code
317
316
id : pushGeneratedCode
317
+ if : ${{ needs.setup.outputs.RUN_CODEGEN == 'true' }}
318
318
run : yarn workspace scripts pushGeneratedCode
319
319
env :
320
320
GITHUB_TOKEN : ${{ secrets.TOKEN_GENERATE_BOT }}
321
321
PR_NUMBER : ${{ github.event.number }}
322
322
323
- codegen_on_main :
324
- runs-on : ubuntu-20.04
325
- timeout-minutes : 10
326
- needs :
327
- - setup
328
- - client_gen
329
- if : |
330
- always() &&
331
- github.ref == 'refs/heads/main' &&
332
- needs.setup.outputs.RUN_CODEGEN == 'true' &&
333
- !contains(needs.*.result, 'cancelled') &&
334
- !contains(needs.*.result, 'failure')
335
- steps :
336
- - uses : actions/checkout@v2
337
- with :
338
- fetch-depth : 0
339
- ref : ${{ github.event.pull_request.head.ref }}
340
- token : ${{ secrets.TOKEN_GENERATE_BOT }}
341
-
342
- - name : Download all the previously stored artifacts
343
- uses : ./.github/actions/restore-artifacts
344
- with :
345
- type : all
346
-
347
- - name : Setup
348
- uses : ./.github/actions/setup
349
- with :
350
- type : minimal
351
-
352
- - name : Push generated code to main
353
- id : pushGeneratedCode
354
- run : yarn workspace scripts pushGeneratedCode
355
- env :
356
- GITHUB_TOKEN : ${{ secrets.TOKEN_GENERATE_BOT }}
357
-
358
323
- name : Spread generation to each repository
359
- if : steps.pushGeneratedCode.exitcode == 0
324
+ if : ${{ steps.pushGeneratedCode.exitcode == 0 && github.ref == 'refs/heads/main' }}
360
325
run : yarn workspace scripts spreadGeneration
361
326
env :
362
327
GITHUB_TOKEN : ${{ secrets.TOKEN_GENERATE_BOT }}
0 commit comments