45
45
run :
46
46
shell : bash
47
47
48
- # by default disable CGO, it's not needed (except on macos)
48
+ # by default disable CGO, it's not needed (except on macos)
49
49
env :
50
50
CGO_ENABLED : 0
51
51
@@ -157,7 +157,7 @@ jobs:
157
157
create-macos-bundle :
158
158
needs : build
159
159
160
- # for not they are exaclty the same
160
+ # for now they are exaclty the same
161
161
strategy :
162
162
matrix :
163
163
arch : [amd64, arm64]
@@ -371,9 +371,6 @@ jobs:
371
371
# vars used by installbuilder
372
372
INSTALLBUILDER_PATH : " /opt/installbuilder-23.11.0/bin/builder"
373
373
INSTALLER_VARS : " project.outputDirectory=$PWD project.version=${GITHUB_REF##*/} workspace=$PWD realname=Arduino_Create_Agent"
374
- # installbuilder will read this vars automatically (defined in installer.xml):
375
- INSTALLER_CERT_WINDOWS_PASSWORD : ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
376
- INSTALLER_CERT_WINDOWS_PFX : " /tmp/ArduinoCerts2020.pfx"
377
374
378
375
strategy :
379
376
fail-fast : false # if one os is failing continue nonetheless
@@ -424,11 +421,6 @@ jobs:
424
421
- name : Save InstallBuilder license to file
425
422
run : echo "${{ secrets.INSTALLER_LICENSE }}" > /tmp/license.xml
426
423
427
- - name : Save Win signing certificate to file
428
- run : echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_PFX}}
429
- if : matrix.os == 'windows-2019'
430
-
431
- # installbuilder reads the env vars with certs paths and use it to sign the installer.
432
424
- name : Launch Bitrock installbuilder
433
425
run : ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.installbuilder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }}
434
426
@@ -443,6 +435,49 @@ jobs:
443
435
path : ArduinoCreateAgent*
444
436
if-no-files-found : error
445
437
438
+ # This job will sign the Windows installer
439
+ sign-windows :
440
+ runs-on : [self-hosted, windows-sign-pc]
441
+ needs : package
442
+
443
+ defaults :
444
+ run :
445
+ shell : bash
446
+
447
+ env :
448
+ INSTALLER_CERT_WINDOWS_CER : " /tmp/cert.cer"
449
+ # We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
450
+ # Keep in mind that this path could change when upgrading to a new runner version
451
+ SIGNTOOL_PATH : " C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"
452
+
453
+ strategy :
454
+ matrix :
455
+ arch : [amd64, 386]
456
+
457
+ steps :
458
+ - name : Download artifact
459
+ uses : actions/download-artifact@v3
460
+ with :
461
+ name : ArduinoCreateAgent-windows-${{ matrix.arch }}
462
+
463
+ - name : Save Win signing certificate to file
464
+ run : echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}}
465
+
466
+ - name : Sign EXE
467
+ env :
468
+ CERT_PASSWORD : ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
469
+ CONTAINER_NAME : ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
470
+ # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
471
+ run : |
472
+ "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Create Agent" -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 "ArduinoCreateAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe"
473
+
474
+ - name : Upload artifacts
475
+ uses : actions/upload-artifact@v3
476
+ with :
477
+ if-no-files-found : error
478
+ name : ArduinoCreateAgent-windows-${{ matrix.arch }}-signed
479
+ path : ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe
480
+
446
481
# This job will generate a dmg mac installer, sign/notarize it.
447
482
generate-sign-dmg :
448
483
needs : notarize-macos
@@ -544,7 +579,7 @@ jobs:
544
579
create-release :
545
580
runs-on : ubuntu-20.04
546
581
environment : production
547
- needs : [build, package, generate-sign-dmg]
582
+ needs : [build, generate-sign-dmg, sign-windows ]
548
583
549
584
steps :
550
585
- name : Checkout
@@ -563,7 +598,7 @@ jobs:
563
598
mv -v ArduinoCreateAgent-linux-amd64/* release/
564
599
cat ArduinoCreateAgent-osx-amd64/*.tar | tar -xvf - -i -C release/
565
600
rm -v release/._ArduinoCreateAgent*.dmg
566
- mv -v ArduinoCreateAgent-windows*/* release/
601
+ mv -v ArduinoCreateAgent-windows*-signed /* release/
567
602
568
603
- name : VirusTotal Scan
569
604
id : virustotal_step
0 commit comments