@@ -227,6 +227,9 @@ jobs:
227
227
needs :
228
228
- select-targets
229
229
- start-self-hosted-runner
230
+ env :
231
+ # Location of artifacts generated by build.
232
+ ARTIFACTS_PATH : electron/build/dist/build-artifacts/
230
233
strategy :
231
234
fail-fast : false
232
235
matrix :
@@ -313,11 +316,18 @@ jobs:
313
316
yarn --cwd ./electron/packager/
314
317
yarn --cwd ./electron/packager/ package
315
318
319
+ # Both macOS jobs generate a channel file with same path and name. The second job to complete would overwrite the
320
+ # file generated by the first in the workflow artifact.
321
+ - name : Prevent macOS channel file overwrite
322
+ if : runner.os == 'macOS'
323
+ run : |
324
+ mv "${{ env.ARTIFACTS_PATH }}/stable-mac.yml" "${{ env.ARTIFACTS_PATH }}/stable-mac-${{ runner.arch }}.yml"
325
+
316
326
- name : Upload [GitHub Actions]
317
327
uses : actions/upload-artifact@v3
318
328
with :
319
329
name : ${{ env.JOB_TRANSFER_ARTIFACT }}
320
- path : electron/build/dist/build-artifacts/
330
+ path : ${{ env.ARTIFACTS_PATH }}
321
331
322
332
stop-self-hosted-runner :
323
333
needs :
@@ -341,6 +351,32 @@ jobs:
341
351
--instance-ids "${{ needs.start-self-hosted-runner.outputs.instance-id }}" \
342
352
--region "${{ env.SELF_HOSTED_RUNNER_INSTANCE_REGION }}"
343
353
354
+ merge-channel-files :
355
+ needs : build
356
+ runs-on : ubuntu-latest
357
+ steps :
358
+ - name : Checkout
359
+ uses : actions/checkout@v3
360
+
361
+ - name : Download job transfer artifact
362
+ uses : actions/download-artifact@v3
363
+ with :
364
+ name : ${{ env.JOB_TRANSFER_ARTIFACT }}
365
+ path : ${{ env.JOB_TRANSFER_ARTIFACT }}
366
+
367
+ - name : Install dependencies
368
+ run : yarn
369
+
370
+ - name : Merge channel files
371
+ run : |
372
+ yarn run merge-channel-files "${{ env.JOB_TRANSFER_ARTIFACT }}"
373
+
374
+ - name : Upload job transfer artifact
375
+ uses : actions/upload-artifact@v3
376
+ with :
377
+ name : ${{ env.JOB_TRANSFER_ARTIFACT }}
378
+ path : ${{ env.JOB_TRANSFER_ARTIFACT }}
379
+
344
380
artifacts :
345
381
name : ${{ matrix.artifact.name }} artifact
346
382
needs : build
@@ -429,7 +465,9 @@ jobs:
429
465
path : CHANGELOG.txt
430
466
431
467
publish :
432
- needs : changelog
468
+ needs :
469
+ - changelog
470
+ - merge-channel-files
433
471
if : github.repository == 'arduino/arduino-ide' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'))
434
472
runs-on : ubuntu-latest
435
473
steps :
@@ -450,7 +488,9 @@ jobs:
450
488
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
451
489
452
490
release :
453
- needs : changelog
491
+ needs :
492
+ - changelog
493
+ - merge-channel-files
454
494
if : startsWith(github.ref, 'refs/tags/')
455
495
runs-on : ubuntu-latest
456
496
steps :
@@ -490,6 +530,7 @@ jobs:
490
530
# This job must run after all jobs that use the transfer artifact.
491
531
needs :
492
532
- build
533
+ - merge-channel-files
493
534
- publish
494
535
- release
495
536
- artifacts
0 commit comments