6
6
- " [0-9]+.[0-9]+.[0-9]+*"
7
7
8
8
env :
9
- TARGET : " /CreateAgent/"
9
+ TARGET : " /CreateAgent/Stable"
10
+ OLD_TARGET : " /CreateBridge/" # compatibility with older releases (we can't change config.ini)
11
+ VERSION_TARGET : " arduino-create-static/agent-metadata/"
10
12
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
11
13
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
12
14
AWS_REGION : " us-east-1" # or https://github.com/aws/aws-cli/issues/5623
@@ -20,21 +22,20 @@ jobs:
20
22
build :
21
23
strategy :
22
24
matrix :
25
+ os : [ubuntu-18.04, windows-2019, macos-10.15]
26
+ arch : [-amd64]
23
27
include :
24
- - operating-system : ubuntu-18.04
25
- - operating-system : windows-2019
28
+ - os : windows-2019
26
29
arch : -386
27
30
ext : " .exe"
28
- - operating-system : windows-2019
29
- arch : -amd64
31
+ - os : windows-2019
30
32
ext : " .exe"
31
- - operating-system : macos-10.15
32
33
33
34
defaults :
34
35
run :
35
36
shell : bash
36
37
37
- runs-on : ${{ matrix.operating-system }}
38
+ runs-on : ${{ matrix.os }}
38
39
39
40
steps :
40
41
- name : Set env vars
64
65
# dependencies used for compiling the GUI
65
66
- name : Install Dependencies (Linux)
66
67
run : sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev
67
- if : matrix.operating-system == 'ubuntu-18.04'
68
+ if : matrix.os == 'ubuntu-18.04'
68
69
69
70
- name : Install Go deps
70
71
# Since 10/23/2019 pwsh is the default shell
@@ -89,38 +90,38 @@ jobs:
89
90
90
91
- name : Build the Agent for linux
91
92
run : task build
92
- if : matrix.operating-system == 'ubuntu-18.04'
93
+ if : matrix.os == 'ubuntu-18.04'
93
94
94
95
# build the agent without GUI support (no tray icon)
95
96
- name : Build the Agent-cli
96
97
run : task build-cli
97
- if : matrix.operating-system == 'ubuntu-18.04'
98
+ if : matrix.os == 'ubuntu-18.04'
98
99
99
100
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28)
100
101
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
101
102
- name : Download tool to embed manifest in win binary
102
103
run : go get github.com/akavel/rsrc
103
- if : matrix.operating-system == 'windows-2019'
104
+ if : matrix.os == 'windows-2019'
104
105
105
106
# building the agent for win requires a different task because of an extra flag
106
107
- name : Build the Agent for win32
107
108
env :
108
109
GOARCH : 386 # 32bit architecture (for support)
109
110
GO386 : 387 # support old instruction sets without MMX (used in the Pentium 4) (will be deprecated in GO > 1.15 https://golang.org/doc/go1.15)
110
111
run : task build-win
111
- if : matrix.operating-system == 'windows-2019' && matrix.arch == '-386'
112
+ if : matrix.os == 'windows-2019' && matrix.arch == '-386'
112
113
113
114
- name : Build the Agent for win64
114
115
run : task build-win # GOARCH=amd64 by default on the runners
115
- if : matrix.operating-system == 'windows-2019' && matrix.arch == '-amd64'
116
+ if : matrix.os == 'windows-2019' && matrix.arch == '-amd64'
116
117
117
118
- name : Build the Agent for macos
118
119
env :
119
120
MACOSX_DEPLOYMENT_TARGET : 10.11 # minimum supported version for mac
120
121
CGO_CFLAGS : -mmacosx-version-min=10.11
121
122
CGO_LDFLAGS : -mmacosx-version-min=10.11
122
123
run : task build
123
- if : matrix.operating-system == 'macos-10.15'
124
+ if : matrix.os == 'macos-10.15'
124
125
125
126
# this will create `public/` dir with compressed full bin (<version>/<os>-<arch>.gz) and a json file
126
127
- name : Create autoupdate files
@@ -129,17 +130,19 @@ jobs:
129
130
130
131
- name : Create autoupdate files for win32
131
132
run : go-selfupdate -platform windows${{ matrix.arch }} arduino-create-agent${{ matrix.ext }} ${TAG_VERSION}
132
- if : matrix.arch == '-386' && steps.prerelease.outputs.IS_PRE != 'true'
133
+ if : matrix.arch == '-386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true'
133
134
134
135
- name : Upload autoupdate files to Arduino downloads servers
135
- run : aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
136
+ run : |
137
+ aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
138
+ aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.OLD_TARGET }}
136
139
if : steps.prerelease.outputs.IS_PRE != 'true'
137
140
138
141
# config.ini is required by the executable when it's run
139
142
- name : Upload artifacts
140
143
uses : actions/upload-artifact@v2
141
144
with :
142
- name : arduino-create-agent-${{ matrix.operating-system }}${{ matrix.arch }}
145
+ name : arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
143
146
path : |
144
147
arduino-create-agent*
145
148
config.ini
@@ -148,16 +151,19 @@ jobs:
148
151
# The code-sign-mac-executable job will download the macos artifact from the previous job, sign e notarize the binary and re-upload it.
149
152
code-sign-mac-executable :
150
153
needs : build
151
- runs-on : macos-10.15
152
- env :
153
- RUNS_ON : macos-10.15 # used to parametrize filenames
154
+ strategy :
155
+ matrix : # to allow support for future architectures
156
+ os : [macos-10.15]
157
+ arch : [-amd64]
158
+
159
+ runs-on : ${{ matrix.os }}
154
160
155
161
steps :
156
162
- name : Download artifact
157
163
uses : actions/download-artifact@v2
158
164
with :
159
- name : arduino-create-agent-${{ env.RUNS_ON }}
160
- path : arduino-create-agent-${{ env.RUNS_ON }}
165
+ name : arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
166
+ path : arduino-create-agent
161
167
162
168
- name : Import Code-Signing Certificates
163
169
run : |
@@ -177,7 +183,7 @@ jobs:
177
183
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
178
184
run : |
179
185
cat > gon.config.hcl <<EOF
180
- source = ["arduino-create-agent-${{ env.RUNS_ON }} /arduino-create-agent"]
186
+ source = ["arduino-create-agent/arduino-create-agent"]
181
187
bundle_id = "cc.arduino.arduino-agent"
182
188
sign {
183
189
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
@@ -191,16 +197,18 @@ jobs:
191
197
192
198
- name : Code sign and notarize app
193
199
run : |
194
- echo "gon will notarize executable in arduino-create-agent-${{ env.RUNS_ON }} /arduino-create-agent"
200
+ echo "gon will notarize executable in arduino-create-agent/arduino-create-agent"
195
201
gon -log-level=debug -log-json gon.config.hcl
196
202
timeout-minutes : 30
197
203
198
204
# This step will overwrite the non signed mac artifact (arduino-create-agent-${{ env.RUNS_ON }})
199
205
- name : Upload artifact
200
206
uses : actions/upload-artifact@v2
201
207
with :
202
- name : arduino-create-agent-${{ env.RUNS_ON }}
203
- path : arduino-create-agent-${{ env.RUNS_ON }}
208
+ name : arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
209
+ path : |
210
+ arduino-create-agent
211
+ !arduino-create-agent.zip
204
212
if-no-files-found : error
205
213
206
214
# This job is responsible for generating the installers (using installbuilder)
@@ -226,26 +234,26 @@ jobs:
226
234
strategy :
227
235
fail-fast : false # if one os is failing continue nonetheless
228
236
matrix : # used to generate installers for different OS and not for runs-on
229
-
237
+ os : [ubuntu-18.04, windows-2019, macos-10.15]
238
+ arch : [-amd64]
230
239
include :
231
- - operating-system : ubuntu-18.04
232
- install-builder-name : linux-x64
240
+ - os : ubuntu-18.04
241
+ install-builder-name : linux
233
242
executable-path : artifacts/linux-amd64/
234
- - operating-system : windows-2019
243
+ - os : windows-2019
235
244
arch : -386
236
245
browser : edge
237
246
install-builder-name : windows
238
247
executable-path : artifacts/windows/
239
248
extension : .exe
240
249
installer-extension : .exe
241
- - operating-system : windows-2019
242
- arch : -amd64
250
+ - os : windows-2019
243
251
browser : edge
244
252
install-builder-name : windows
245
253
executable-path : artifacts/windows/
246
254
extension : .exe
247
255
installer-extension : .exe
248
- - operating-system : macos-10.15
256
+ - os : macos-10.15
249
257
browser : safari
250
258
install-builder-name : osx
251
259
executable-path : ' skel/ArduinoCreateAgent.app/Contents/MacOS/'
@@ -264,31 +272,31 @@ jobs:
264
272
- name : Download artifact
265
273
uses : actions/download-artifact@v2
266
274
with :
267
- name : arduino-create-agent-${{ matrix.operating-system }}${{ matrix.arch }}
275
+ name : arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
268
276
path : ${{ matrix.executable-path }} # path expected by installbuilder
269
277
270
278
# zip artifacts do not mantain executable permission
271
279
- name : Make executable
272
280
run : chmod -v +x ${{ matrix.executable-path }}arduino-create-agent*
273
- if : matrix.operating-system == 'ubuntu-18.04' || matrix.operating-system == 'macos-10.15'
281
+ if : matrix.os == 'ubuntu-18.04' || matrix.os == 'macos-10.15'
274
282
275
283
- name : Rename executable to Arduino_Create_Agent
276
284
run : mv -v ${{ matrix.executable-path }}arduino-create-agent${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }}
277
285
278
286
- name : Rename executable to Arduino_Create_Agent_cli
279
287
run : mv -v ${{ matrix.executable-path }}arduino-create-agent_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }}
280
- if : matrix.operating-system == 'ubuntu-18.04'
288
+ if : matrix.os == 'ubuntu-18.04'
281
289
282
290
- name : Save InstallBuilder license to file
283
291
run : echo "${{ secrets.INSTALLER_LICENSE }}" > /tmp/license.xml
284
292
285
293
- name : Save Win signing certificate to file
286
294
run : echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_PFX}}
287
- if : matrix.operating-system == 'windows-2019'
295
+ if : matrix.os == 'windows-2019'
288
296
289
297
- name : Save macos signing certificate to file
290
298
run : echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > ${{ env.INSTALLER_CERT_MAC_P12 }}
291
- if : matrix.operating-system == 'macos-10.15'
299
+ if : matrix.os == 'macos-10.15'
292
300
293
301
# win(edge),mac(safari) -> CERT_INSTALL and win,mac:(ff,chrome) -> CHOICE_CERT_INSTALL
294
302
# installbuilder reads the env vars with certs paths and use it to sign the installer.
@@ -300,17 +308,17 @@ jobs:
300
308
cp -vr ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-chrome${{matrix.installer-extension}}
301
309
mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-firefox${{matrix.installer-extension}}
302
310
rm -r ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-C*
303
- if : matrix.operating-system == 'windows-2019' || matrix.operating-system == 'macos-10.15'
311
+ if : matrix.os == 'windows-2019' || matrix.os == 'macos-10.15'
304
312
305
313
# linux
306
314
- name : Launch Bitrock installbuilder-20 with NO_CERT_INSTALL
307
315
run : |
308
- ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.NO_CERT_INSTALL }}
309
- cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}- installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome.run
310
- mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}- installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox.run
311
- cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}- installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-chrome.tar.gz
312
- mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}- installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-firefox.tar.gz
313
- if : matrix.operating-system == 'ubuntu-18.04'
316
+ ${{ env.INSTALLBUILDER_PATH }} build installer.xml linux-x64 --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.NO_CERT_INSTALL }}
317
+ cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64- installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-chrome.run
318
+ mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64- installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-firefox.run
319
+ cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64- installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-chrome.tar.gz
320
+ mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64- installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-firefox.tar.gz
321
+ if : matrix.os == 'ubuntu-18.04'
314
322
315
323
- name : Upload artifacts
316
324
uses : actions/upload-artifact@v2
@@ -322,22 +330,22 @@ jobs:
322
330
# This job will sign and notarize mac installers
323
331
code-sign-mac-installers :
324
332
needs : package
325
- runs-on : macos-10.15
326
-
327
333
strategy :
328
334
matrix :
329
335
browser : [safari, firefox, chrome]
336
+ arch : [-amd64]
330
337
338
+ runs-on : macos-10.15
331
339
steps :
332
340
- name : Download artifact
333
341
uses : actions/download-artifact@v2
334
342
with :
335
- name : ArduinoCreateAgent-osx
343
+ name : ArduinoCreateAgent-osx${{ matrix.arch }}
336
344
path : ArduinoCreateAgent-osx
337
345
338
346
# zip artifacts do not mantain executable permission
339
347
- name : Make executable
340
- run : chmod -v +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.app/Contents/MacOS/*
348
+ run : chmod -v +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }} -installer-${{ matrix.browser }}.app/Contents/MacOS/*
341
349
342
350
- name : Import Code-Signing Certificates
343
351
run : |
@@ -357,33 +365,33 @@ jobs:
357
365
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
358
366
run : |
359
367
cat > gon.config_installer.hcl <<EOF
360
- source = ["ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.app"]
368
+ source = ["ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }} -installer-${{ matrix.browser }}.app"]
361
369
bundle_id = "cc.arduino.arduino-agent-installer"
362
370
363
371
sign {
364
372
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
365
373
}
366
374
367
375
dmg {
368
- output_path = "ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.dmg"
376
+ output_path = "ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }} -installer-${{ matrix.browser }}.dmg"
369
377
volume_name = "ArduinoCreateAgent"
370
378
}
371
379
EOF
372
380
373
381
- name : Code sign and notarize app
374
382
run : |
375
- echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.app"
383
+ echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }} -installer-${{ matrix.browser }}.app"
376
384
gon -log-level=debug -log-json gon.config_installer.hcl
377
385
timeout-minutes : 30
378
386
379
387
# tar dmg file to keep executable permission
380
388
- name : Tar files to keep permissions
381
- run : tar -cvf ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.tar ArduinoCreateAgent-${GITHUB_REF##*/}-osx-installer-${{ matrix.browser }}.dmg
389
+ run : tar -cvf ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }} -installer-${{ matrix.browser }}.tar ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }} -installer-${{ matrix.browser }}.dmg
382
390
383
391
- name : Upload artifacts
384
392
uses : actions/upload-artifact@v2
385
393
with :
386
- name : ArduinoCreateAgent-osx
394
+ name : ArduinoCreateAgent-osx${{ matrix.arch }}
387
395
path : ArduinoCreateAgent*.tar
388
396
if-no-files-found : error
389
397
@@ -407,9 +415,9 @@ jobs:
407
415
- name : prepare artifacts for the release
408
416
run : |
409
417
mkdir release
410
- chmod -v +x ArduinoCreateAgent-linux-x64 /*.run
411
- mv -v ArduinoCreateAgent-linux-x64 /* release/
412
- cat ArduinoCreateAgent-osx/*.tar | tar -xvf - -i -C release/
418
+ chmod -v +x ArduinoCreateAgent-linux-amd64 /*.run
419
+ mv -v ArduinoCreateAgent-linux-amd64 /* release/
420
+ cat ArduinoCreateAgent-osx-amd64 /*.tar | tar -xvf - -i -C release/
413
421
rm -v release/._ArduinoCreateAgent*.dmg
414
422
mv -v ArduinoCreateAgent-windows*/* release/
415
423
@@ -418,7 +426,7 @@ jobs:
418
426
uses : crazy-max/ghaction-virustotal@v2
419
427
with :
420
428
vt_api_key : ${{ secrets.VIRUSTOTAL_API_KEY }}
421
- update_release_body : false # `true` won't work becasue trigger type is not release
429
+ update_release_body : false # `true` won't work because trigger type is not release
422
430
files : |
423
431
release/*.exe
424
432
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
@@ -455,5 +463,11 @@ jobs:
455
463
file : release/*
456
464
457
465
- name : Upload release files on Arduino downloads servers
458
- run : aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }} --include "*"
466
+ run : aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
467
+ if : steps.prerelease.outputs.IS_PRE != 'true'
468
+
469
+ - name : Update version file (used by frontend to trigger autoupdate and create filename)
470
+ run : |
471
+ echo {\"Version\": \"${GITHUB_REF##*/}\"} > /tmp/agent-version.json
472
+ aws s3 sync /tmp/agent-version.json s3://${{ env.VERSION_TARGET }}
459
473
if : steps.prerelease.outputs.IS_PRE != 'true'
0 commit comments