@@ -326,51 +326,35 @@ jobs:
326
326
327
327
# This job is responsible for generating the installers (using installbuilder)
328
328
package :
329
- needs : notarize-macos
329
+ needs : build
330
330
runs-on : ubuntu-20.04
331
331
332
332
env :
333
333
# vars used by installbuilder
334
334
INSTALLBUILDER_PATH : " /opt/installbuilder-22.10.0/bin/builder"
335
335
INSTALLER_VARS : " project.outputDirectory=$PWD project.version=${GITHUB_REF##*/} workspace=$PWD realname=Arduino_Create_Agent"
336
- # vars passed to installbuilder to install https certs automatically
337
- CREATE_OSX_BUNDLED_MG : 0 # tell installbuilder to not create the DMG, gon will take care of that later
338
336
# installbuilder will read this vars automatically (defined in installer.xml):
339
337
INSTALLER_CERT_WINDOWS_PASSWORD : ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
340
338
INSTALLER_CERT_WINDOWS_PFX : " /tmp/ArduinoCerts2020.pfx"
341
- INSTALLER_CERT_MAC_PASSWORD : ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}
342
- INSTALLER_CERT_MAC_P12 : " /tmp/ArduinoCerts2020.p12"
343
339
344
340
strategy :
345
341
fail-fast : false # if one os is failing continue nonetheless
346
342
matrix : # used to generate installers for different OS and not for runs-on
347
- os : [ubuntu-20.04, windows-2019, macos-12 ]
343
+ os : [ubuntu-20.04, windows-2019]
348
344
arch : [amd64]
349
345
include :
350
346
- os : ubuntu-20.04
351
- install-builder-name : linux
352
- executable-path : artifacts/linux-amd64/
347
+ platform-name : linux
353
348
installer-extension : .run
354
- artifact-name : arduino-create-agent-ubuntu-20.04-amd64
355
349
- os : windows-2019
356
350
arch : 386
357
- install-builder-name : windows
358
- executable-path : artifacts/windows/
351
+ platform-name : windows
359
352
extension : .exe
360
353
installer-extension : .exe
361
- artifact-name : arduino-create-agent-windows-2019-386
362
354
- os : windows-2019
363
- install-builder-name : windows
364
- executable-path : artifacts/windows/
355
+ platform-name : windows
365
356
extension : .exe
366
357
installer-extension : .exe
367
- artifact-name : arduino-create-agent-windows-2019-amd64
368
- - os : macos-12
369
- install-builder-name : osx
370
- executable-path : artifacts/macos/ArduinoCreateAgent.app
371
- installer-extension : .app
372
- artifact-name : ArduinoCreateAgent.app_amd64_notarized # this artifact contains the Contents directory
373
- # here we support only amd64 for macos. Hopefully in the future installbuilder for macOS will be removed, see https://github.com/arduino/arduino-create-agent/issues/739
374
358
375
359
container :
376
360
image : floydpink/ubuntu-install-builder:22.10.0
@@ -385,28 +369,19 @@ jobs:
385
369
- name : Download artifact
386
370
uses : actions/download-artifact@v3
387
371
with :
388
- name : ${{ matrix.artifact-name }}
389
- path : ${{ matrix.executable-path }} # path expected by installbuilder
390
-
391
- - name : unzip mac notarized bundle
392
- working-directory : ${{ matrix.executable-path }}
393
- run : |
394
- apt install unzip
395
- unzip ${{ matrix.artifact-name }}.zip
396
- rm ${{ matrix.artifact-name }}.zip
397
- if : matrix.os == 'macos-12'
372
+ name : ${{ env.PROJECT_NAME }}-${{ matrix.os }}-${{ matrix.arch }}
373
+ path : artifacts/${{ matrix.platform-name }}/ # path expected by installbuilder
398
374
399
375
# zip artifacts do not mantain executable permission
400
376
- name : Make executable
401
- run : chmod -v +x ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}*
377
+ run : chmod -v +x artifacts/ ${{ matrix.platform-name }}/ ${{ env.PROJECT_NAME }}*
402
378
if : matrix.os == 'ubuntu-20.04'
403
379
404
380
- name : Rename executable to Arduino_Create_Agent
405
- run : mv -v ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }}
406
- if : matrix.os != 'macos-12'
381
+ run : mv -v artifacts/${{ matrix.platform-name }}/${{ env.PROJECT_NAME }}${{ matrix.extension }} artifacts/${{ matrix.platform-name }}/Arduino_Create_Agent${{ matrix.extension }}
407
382
408
383
- name : Rename executable to Arduino_Create_Agent_cli
409
- run : mv -v ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }}
384
+ run : mv -v artifacts/ ${{ matrix.platform-name }}/ ${{ env.PROJECT_NAME }}_cli${{ matrix.extension }} artifacts/ ${{ matrix.platform-name }}/ Arduino_Create_Agent_cli${{ matrix.extension }}
410
385
if : matrix.os == 'ubuntu-20.04'
411
386
412
387
- name : Save InstallBuilder license to file
@@ -416,44 +391,64 @@ jobs:
416
391
run : echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_PFX}}
417
392
if : matrix.os == 'windows-2019'
418
393
419
- - name : Save macos signing certificate to file
420
- run : echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > ${{ env.INSTALLER_CERT_MAC_P12 }}
421
- if : matrix.os == 'macos-12'
422
-
423
394
# installbuilder reads the env vars with certs paths and use it to sign the installer.
424
395
- name : Launch Bitrock installbuilder
425
396
run : |
426
- ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.install-builder -name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }}
397
+ ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.platform -name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }}
427
398
428
399
- name : Generate archive
429
- run : tar -czvf ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder- name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder -name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}}
400
+ run : tar -czvf ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.platform- name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.platform -name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}}
430
401
if : matrix.os == 'ubuntu-20.04'
431
402
432
403
- name : Upload artifacts
433
404
uses : actions/upload-artifact@v3
434
405
with :
435
- name : ArduinoCreateAgent-${{ matrix.install-builder -name }}-${{ matrix.arch }}
406
+ name : ArduinoCreateAgent-${{ matrix.platform -name }}-${{ matrix.arch }}
436
407
path : ArduinoCreateAgent*
437
408
if-no-files-found : error
438
409
439
- # This job will sign and notarize mac installers
440
- code -sign-mac-installers :
441
- needs : package
410
+ # This job will generate a dmg mac installer, sign/notarize it.
411
+ generate -sign-dmg :
412
+ needs : notarize-macos
442
413
strategy :
443
414
matrix :
444
415
arch : [amd64]
445
416
446
417
runs-on : macos-12
447
418
steps :
419
+ - name : Checkout repo with icons/background
420
+ uses : actions/checkout@v3
421
+ with :
422
+ repository : ' bcmi-labs/arduino-create-agent-installer' # the repo which contains the icons/background
423
+ token : ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }}
424
+
448
425
- name : Download artifact
449
426
uses : actions/download-artifact@v3
450
427
with :
451
- name : ArduinoCreateAgent-osx- ${{ matrix.arch }}
452
- path : ArduinoCreateAgent-osx
428
+ name : ArduinoCreateAgent.app_ ${{ matrix.arch }}_notarized
429
+ path : ArduinoCreateAgent.app
453
430
454
- # zip artifacts do not mantain executable permission
455
- - name : Make executable
456
- run : chmod -v +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.app/Contents/MacOS/*
431
+ - name : unzip artifact
432
+ working-directory : ArduinoCreateAgent.app
433
+ run : |
434
+ unzip ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip
435
+ rm ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip
436
+
437
+ - name : Install create-dmg
438
+ run : brew install create-dmg
439
+
440
+ - name : Genarate DMG
441
+ run : |
442
+ create-dmg \
443
+ --volname "ArduinoCreateAgent" \
444
+ --background "installer_icons/background.tiff" \
445
+ --window-pos 200 120 \
446
+ --window-size 500 320 \
447
+ --icon-size 80 \
448
+ --icon "ArduinoCreateAgent.app" 125 150 \
449
+ --app-drop-link 375 150 \
450
+ "ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg" \
451
+ "ArduinoCreateAgent.app"
457
452
458
453
- name : Import Code-Signing Certificates
459
454
run : |
@@ -483,22 +478,23 @@ jobs:
483
478
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
484
479
run : |
485
480
cat > gon.config_installer.hcl <<EOF
486
- source = ["ArduinoCreateAgent-osx/ArduinoCreateAgent- ${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.app "]
481
+ source = ["ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg "]
487
482
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}-installer"
488
483
489
484
sign {
490
485
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
491
486
}
492
487
493
- dmg {
494
- output_path = "ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg"
495
- volume_name = "ArduinoCreateAgent"
488
+ # Ask Gon for zip output to force notarization process to take place.
489
+ # The CI will not upload the zip output
490
+ zip {
491
+ output_path = "ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip"
496
492
}
497
493
EOF
498
494
499
495
- name : Code sign and notarize app
500
496
run : |
501
- echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.app "
497
+ echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg "
502
498
gon -log-level=debug -log-json gon.config_installer.hcl
503
499
timeout-minutes : 30
504
500
@@ -515,7 +511,7 @@ jobs:
515
511
516
512
create-release :
517
513
runs-on : ubuntu-20.04
518
- needs : [build, code -sign-mac-installers ]
514
+ needs : [build, package, generate -sign-dmg ]
519
515
520
516
steps :
521
517
- name : Checkout
0 commit comments