@@ -107,21 +107,40 @@ jobs:
107
107
run : task go:build-win # GOARCH=amd64 by default on the runners
108
108
if : matrix.os == 'windows-2019' && matrix.arch == 'amd64'
109
109
110
- - name : Build the Agent for macos
110
+ - name : Build the Agent for macos amd64
111
111
env :
112
112
CGO_ENABLED : 1
113
113
MACOSX_DEPLOYMENT_TARGET : 10.15 # minimum supported version for mac
114
114
CGO_CFLAGS : -mmacosx-version-min=10.15
115
115
CGO_LDFLAGS : -mmacosx-version-min=10.15
116
- run : task go:build
116
+ run : |
117
+ task go:build
118
+ mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64
119
+ if : matrix.os == 'macos-12'
120
+
121
+ - name : Build the Agent for macos arm64
122
+ env :
123
+ CGO_ENABLED : 1
124
+ MACOSX_DEPLOYMENT_TARGET : 10.15 # minimum supported version for mac
125
+ CGO_CFLAGS : -mmacosx-version-min=10.15
126
+ CGO_LDFLAGS : -mmacosx-version-min=10.15
127
+ GOARCH : arm64
128
+ run : |
129
+ task go:build
130
+ mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64
131
+ if : matrix.os == 'macos-12'
132
+
133
+ - name : Create universal macos executable
134
+ shell : zsh
135
+ run : lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64
117
136
if : matrix.os == 'macos-12'
118
137
119
138
# this will create `public/` dir with compressed full bin (<version>/<os>-<arch>.gz) and a json file
120
139
- name : Create autoupdate files
121
140
run : go-selfupdate ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
122
141
if : matrix.arch != '386' && steps.prerelease.outputs.IS_PRE != 'true'
123
142
124
- # for now we do not distribute m1 build, this is a workaround for now
143
+ # for now we do not distribute m1 build, this is a workaround for now
125
144
- name : Copy autoupdate file for darwin-arm64 (m1 arch)
126
145
working-directory : public/
127
146
run : |
@@ -132,7 +151,7 @@ jobs:
132
151
- name : Create autoupdate files for win32
133
152
run : go-selfupdate -platform windows-${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
134
153
if : matrix.arch == '386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true'
135
-
154
+
136
155
- name : configure aws credentials
137
156
uses : aws-actions/configure-aws-credentials@v4
138
157
with :
@@ -311,7 +330,7 @@ jobs:
311
330
run : |
312
331
wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip
313
332
unzip gon_macos.zip -d /usr/local/bin
314
-
333
+
315
334
- name : Write gon config to file
316
335
run : |
317
336
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
@@ -323,7 +342,7 @@ jobs:
323
342
}
324
343
325
344
EOF
326
-
345
+
327
346
- name : Notarize app bundle
328
347
run : |
329
348
gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
@@ -449,17 +468,17 @@ jobs:
449
468
# We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
450
469
# Keep in mind that this path could change when upgrading to a new runner version
451
470
SIGNTOOL_PATH : " C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"
452
-
471
+
453
472
strategy :
454
473
matrix :
455
474
arch : [amd64, 386]
456
-
475
+
457
476
steps :
458
477
- name : Download artifact
459
478
uses : actions/download-artifact@v4
460
479
with :
461
480
name : ArduinoCreateAgent-windows-${{ matrix.arch }}
462
-
481
+
463
482
- name : Save Win signing certificate to file
464
483
run : echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}}
465
484
@@ -468,7 +487,7 @@ jobs:
468
487
CERT_PASSWORD : ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
469
488
CONTAINER_NAME : ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
470
489
# https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
471
- run : |
490
+ run : |
472
491
"${{ 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
492
474
493
- name : Upload artifacts
0 commit comments