55
55
- config:
56
56
# Human identifier for the job.
57
57
name: Windows
58
- runs-on: windows-2019
58
+ runs-on: [self-hosted, windows-sign-pc]
59
59
# The value is a string representing a JSON document.
60
60
# Setting this to null causes the job to run directly in the runner machine instead of in a container.
61
61
container: |
75
75
artifacts:
76
76
- path: '*Windows_64bit.exe'
77
77
name: Windows_X86-64_interactive_installer
78
- - path: '*Windows_64bit_unsigned.exe'
79
- name: Windows_X86-64_interactive_installer_unsigned
80
78
- path: '*Windows_64bit.msi'
81
79
name: Windows_X86-64_MSI
82
- - path: '*Windows_64bit_unsigned.msi'
83
- name: Windows_X86-64_MSI_unsigned
84
80
- path: '*Windows_64bit.zip'
85
81
name: Windows_X86-64_zip
86
- - path: '*Windows_64bit_unsigned.zip'
87
- name: Windows_X86-64_zip_unsigned
88
82
- config:
89
83
name: Linux
90
84
runs-on: ubuntu-latest
@@ -278,6 +272,7 @@ jobs:
278
272
env :
279
273
# Location of artifacts generated by build.
280
274
BUILD_ARTIFACTS_PATH : electron-app/dist/build-artifacts
275
+ IS_WINDOWS_CONFIG : ${{ matrix.config.name == 'Windows' }}
281
276
strategy :
282
277
matrix :
283
278
config : ${{ fromJson(needs.select-targets.outputs.build-matrix) }}
@@ -301,42 +296,42 @@ jobs:
301
296
uses : actions/checkout@v3
302
297
303
298
- name : Install Node.js
304
- if : fromJSON(matrix.config.container) == null
299
+ if : fromJSON(matrix.config.container) == null && env.IS_WINDOWS_CONFIG == false
305
300
uses : actions/setup-node@v4
306
301
with :
307
302
node-version : ${{ env.NODE_VERSION }}
308
303
registry-url : ' https://registry.npmjs.org'
309
304
cache : ' yarn'
310
305
311
306
- name : Install Python 3.x
312
- if : fromJSON(matrix.config.container) == null
307
+ if : fromJSON(matrix.config.container) == null && env.IS_WINDOWS_CONFIG == false
313
308
uses : actions/setup-python@v5
314
309
with :
315
310
python-version : ' 3.11.x'
316
311
317
312
- name : Install Go
318
- if : fromJSON(matrix.config.container) == null
313
+ if : fromJSON(matrix.config.container) == null && env.IS_WINDOWS_CONFIG == false
319
314
uses : actions/setup-go@v5
320
315
with :
321
316
go-version : ${{ env.GO_VERSION }}
322
317
323
318
- name : Install Go
324
319
# actions/setup-go@v5 has dependency on a higher version of glibc than available in the Linux container.
325
- if : fromJSON(matrix.config.container) != null
320
+ if : fromJSON(matrix.config.container) != null && env.IS_WINDOWS_CONFIG == false
326
321
uses : actions/setup-go@v4
327
322
with :
328
323
go-version : ${{ env.GO_VERSION }}
329
324
330
325
- name : Install Taskfile
331
- if : fromJSON(matrix.config.container) == null
326
+ if : fromJSON(matrix.config.container) == null && env.IS_WINDOWS_CONFIG == false
332
327
uses : arduino/setup-task@v2
333
328
with :
334
329
repo-token : ${{ secrets.GITHUB_TOKEN }}
335
330
version : 3.x
336
331
337
332
- name : Install Taskfile
338
333
# actions/setup-task@v2 has dependency on a higher version of glibc than available in the Linux container.
339
- if : fromJSON(matrix.config.container) != null
334
+ if : fromJSON(matrix.config.container) != null && env.IS_WINDOWS_CONFIG == false
340
335
uses : arduino/setup-task@v1
341
336
with :
342
337
repo-token : ${{ secrets.GITHUB_TOKEN }}
@@ -353,7 +348,6 @@ jobs:
353
348
IS_NIGHTLY : ${{ needs.build-type-determination.outputs.is-nightly }}
354
349
IS_RELEASE : ${{ needs.build-type-determination.outputs.is-release }}
355
350
CAN_SIGN : ${{ secrets[matrix.config.certificate-secret] != '' }}
356
- IS_WINDOWS_CONFIG : ${{ matrix.config.name == 'Windows' }}
357
351
# The CREATE_* environment vars are only used to run tests. These secrets are optional. Dependent tests will
358
352
# be skipped if not available.
359
353
CREATE_USERNAME : ${{ secrets.CREATE_USERNAME }}
@@ -415,76 +409,11 @@ jobs:
415
409
name : ${{ env.JOB_TRANSFER_ARTIFACT }}
416
410
path : ${{ env.BUILD_ARTIFACTS_PATH }}
417
411
418
- sign-windows :
419
- runs-on : [self-hosted, windows-sign-pc]
420
- needs : build
421
-
422
- defaults :
423
- run :
424
- shell : bash
425
-
426
- env :
427
- BUILD_ARTIFACTS_PATH : electron-app/dist/build-artifacts
428
- INSTALLER_CERT_WINDOWS_CER : " /tmp/cert.cer"
429
- # We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
430
- # Keep in mind that this path could change when upgrading to a new runner version
431
- SIGNTOOL_PATH : " C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"
432
-
433
- steps :
434
- - name : Download artifact
435
- uses : actions/download-artifact@v3
436
- with :
437
- name : ${{ env.JOB_TRANSFER_ARTIFACT }}
438
- path : ${{ env.BUILD_ARTIFACTS_PATH }}
439
-
440
- - name : Find and process exe and msi artifacts
441
- shell : bash
442
- env :
443
- CERT_PASSWORD : ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
444
- CONTAINER_NAME : ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
445
- # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
446
- run : |
447
- shopt -s nullglob
448
- for ARTIFACT in "${{ env.BUILD_ARTIFACTS_PATH }}"/*_unsigned.{exe,msi}; do
449
- echo "Processing $ARTIFACT"
450
- FILENAME=$(basename "$ARTIFACT")
451
- BASE_NAME="${FILENAME%.*}"
452
- EXTENSION="${FILENAME##*.}"
453
- # Remove '_unsigned' from the base name
454
- SIGNED_BASE_NAME="${BASE_NAME%_unsigned}"
455
-
456
- # Sign and rename EXE and MSI files
457
- if [[ "$EXTENSION" == "exe" || "$EXTENSION" == "msi" ]]; then
458
- echo "Signing $ARTIFACT"
459
- "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino IDE" -f ${{ env.INSTALLER_CERT_WINDOWS_CER }} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "$ARTIFACT"
460
- SIGNED_ARTIFACT_PATH="${{ env.BUILD_ARTIFACTS_PATH }}/${SIGNED_BASE_NAME}.${EXTENSION}"
461
- mv "$ARTIFACT" "$SIGNED_ARTIFACT_PATH"
462
- echo "Renamed $ARTIFACT to $SIGNED_ARTIFACT_PATH"
463
- fi
464
- done
465
-
466
- - name : Upload signed EXE
467
- uses : actions/upload-artifact@v3
468
- with :
469
- name : Windows_X86-64_interactive_installer
470
- path : ${{ env.BUILD_ARTIFACTS_PATH }}/*Windows_64bit.exe
471
-
472
- - name : Upload signed MSI
473
- uses : actions/upload-artifact@v3
474
- with :
475
- name : Windows_X86-64_MSI
476
- path : ${{ env.BUILD_ARTIFACTS_PATH }}/*Windows_64bit.msi
477
-
478
- # This step is needed because the self hosted runner does not delete files automatically
479
- - name : Clean up artifacts
480
- run : rm -rf ${{ env.BUILD_ARTIFACTS_PATH }}
481
-
482
412
merge-channel-files :
483
413
needs :
484
414
- build-type-determination
485
415
- select-targets
486
416
- build
487
- - sign-windows
488
417
if : needs.select-targets.outputs.merge-channel-files == 'true'
489
418
runs-on : ubuntu-latest
490
419
permissions : {}
@@ -548,7 +477,6 @@ jobs:
548
477
needs :
549
478
- select-targets
550
479
- build
551
- - sign-windows
552
480
if : always() && needs.build.result != 'skipped'
553
481
runs-on : ubuntu-latest
554
482
@@ -573,7 +501,6 @@ jobs:
573
501
needs :
574
502
- build-type-determination
575
503
- build
576
- - sign-windows
577
504
runs-on : ubuntu-latest
578
505
outputs :
579
506
BODY : ${{ steps.changelog.outputs.BODY }}
@@ -623,7 +550,6 @@ jobs:
623
550
- build-type-determination
624
551
- merge-channel-files
625
552
- changelog
626
- - sign-windows
627
553
if : >
628
554
always() &&
629
555
needs.build-type-determination.result == 'success' &&
@@ -657,7 +583,6 @@ jobs:
657
583
- build-type-determination
658
584
- merge-channel-files
659
585
- changelog
660
- - sign-windows
661
586
if : >
662
587
always() &&
663
588
needs.build-type-determination.result == 'success' &&
@@ -709,7 +634,6 @@ jobs:
709
634
- publish
710
635
- release
711
636
- artifacts
712
- - sign-windows
713
637
if : always() && needs.build.result != 'skipped'
714
638
runs-on : ubuntu-latest
715
639
0 commit comments