40
40
ext : " .exe"
41
41
- os : windows-2019
42
42
ext : " .exe"
43
+ - os : macos-12
44
+ arch : arm64
43
45
44
46
defaults :
45
47
run :
@@ -107,32 +109,35 @@ jobs:
107
109
run : task go:build-win # GOARCH=amd64 by default on the runners
108
110
if : matrix.os == 'windows-2019' && matrix.arch == 'amd64'
109
111
110
- - name : Build the Agent for macos
112
+ - name : Build the Agent for macos amd64
111
113
env :
112
114
CGO_ENABLED : 1
113
115
MACOSX_DEPLOYMENT_TARGET : 10.15 # minimum supported version for mac
114
116
CGO_CFLAGS : -mmacosx-version-min=10.15
115
117
CGO_LDFLAGS : -mmacosx-version-min=10.15
118
+ GOOS : " darwin"
119
+ GOARCH : " amd64"
116
120
run : task go:build
117
- if : matrix.os == 'macos-12'
121
+ if : matrix.os == 'macos-12' && matrix.arch == 'amd64'
122
+
123
+ - name : Build the Agent for macos arm64
124
+ env :
125
+ CGO_ENABLED : 1
126
+ MACOSX_DEPLOYMENT_TARGET : 10.15 # minimum supported version for mac
127
+ CGO_CFLAGS : -mmacosx-version-min=10.15
128
+ CGO_LDFLAGS : -mmacosx-version-min=10.15
129
+ run : task go:build-macos-arm
130
+ if : matrix.os == 'macos-12' && matrix.arch == 'arm64'
118
131
119
132
# this will create `public/` dir with compressed full bin (<version>/<os>-<arch>.gz) and a json file
120
133
- name : Create autoupdate files
121
134
run : go-selfupdate ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
122
135
if : matrix.arch != '386' && steps.prerelease.outputs.IS_PRE != 'true'
123
136
124
- # for now we do not distribute m1 build, this is a workaround for now
125
- - name : Copy autoupdate file for darwin-arm64 (m1 arch)
126
- working-directory : public/
127
- run : |
128
- cp darwin-amd64.json darwin-arm64.json
129
- cp ${TAG_VERSION}/darwin-amd64.gz ${TAG_VERSION}/darwin-arm64.gz
130
- if : matrix.os == 'macos-12' && steps.prerelease.outputs.IS_PRE != 'true'
131
-
132
137
- name : Create autoupdate files for win32
133
138
run : go-selfupdate -platform windows-${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
134
139
if : matrix.arch == '386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true'
135
-
140
+
136
141
- name : configure aws credentials
137
142
uses : aws-actions/configure-aws-credentials@v4
138
143
with :
@@ -176,7 +181,7 @@ jobs:
176
181
- name : Download artifact
177
182
uses : actions/download-artifact@v4
178
183
with :
179
- name : ${{ env.PROJECT_NAME }}-macos-12-amd64 # if we want to support darwin-arm64 in the future for real this has to change.
184
+ name : ${{ env.PROJECT_NAME }}-macos-12-${{ matrix.arch }}
180
185
path : ${{ env.EXE_PATH }}
181
186
182
187
- name : Remove placeholder file
@@ -311,7 +316,7 @@ jobs:
311
316
run : |
312
317
wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip
313
318
unzip gon_macos.zip -d /usr/local/bin
314
-
319
+
315
320
- name : Write gon config to file
316
321
run : |
317
322
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
@@ -323,7 +328,7 @@ jobs:
323
328
}
324
329
325
330
EOF
326
-
331
+
327
332
- name : Notarize app bundle
328
333
run : |
329
334
gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
@@ -449,17 +454,17 @@ jobs:
449
454
# We are hardcoding the path for signtool because is not present on the windows PATH env var by default.
450
455
# Keep in mind that this path could change when upgrading to a new runner version
451
456
SIGNTOOL_PATH : " C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"
452
-
457
+
453
458
strategy :
454
459
matrix :
455
460
arch : [amd64, 386]
456
-
461
+
457
462
steps :
458
463
- name : Download artifact
459
464
uses : actions/download-artifact@v4
460
465
with :
461
466
name : ArduinoCreateAgent-windows-${{ matrix.arch }}
462
-
467
+
463
468
- name : Save Win signing certificate to file
464
469
run : echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}}
465
470
@@ -468,7 +473,7 @@ jobs:
468
473
CERT_PASSWORD : ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
469
474
CONTAINER_NAME : ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
470
475
# https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken
471
- run : |
476
+ run : |
472
477
"${{ 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
478
474
479
- name : Upload artifacts
0 commit comments