-
-
Notifications
You must be signed in to change notification settings - Fork 151
486 lines (415 loc) · 22.2 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
name: release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
env:
TARGET: "/CreateAgent/Stable"
OLD_TARGET: "/CreateBridge/" # compatibility with older releases (we can't change config.ini)
VERSION_TARGET: "arduino-create-static/agent-metadata/"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623
KEYCHAIN: "sign.keychain"
INSTALLER_CERT_MAC_PATH: "/tmp/ArduinoCerts2020.p12"
AC_USERNAME: ${{ secrets.AC_USERNAME }} # used by gon
AC_PASSWORD: ${{ secrets.AC_PASSWORD }} # used by gon
jobs:
# The build job is responsible for: configuring the environment, testing and compiling process
build:
strategy:
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
arch: [-amd64]
include:
- os: windows-2019
arch: -386
ext: ".exe"
- os: windows-2019
ext: ".exe"
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Set env vars
run: |
echo "TAG_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo $(go env GOPATH)/bin >> $GITHUB_PATH
- name: Identify Prerelease
# This is a workaround while waiting for create-release action to implement auto pre-release based on tag
id: prerelease
run: |
curl -L -s https://github.com/fsaintjacques/semver-tool/archive/3.1.0.zip -o /tmp/3.1.0.zip
unzip -p /tmp/3.1.0.zip semver-tool-3.1.0/src/semver >/tmp/semver && chmod +x /tmp/semver
if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "::set-output name=IS_PRE::true"; fi
- name: Disable EOL conversions
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.14"
# dependencies used for compiling the GUI
- name: Install Dependencies (Linux)
run: sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev
if: matrix.os == 'ubuntu-18.04'
- name: Install Go deps
# Since 10/23/2019 pwsh is the default shell
# on Windows, but pwsh fails to install protoc-gen-go so
# we force bash as default shell for all OSes in this task
run: |
go get github.com/golangci/govet
go get golang.org/x/lint/golint
go get -u github.com/sanbornm/go-selfupdate/...
- name: Install Taskfile
uses: arduino/actions/setup-taskfile@master
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check the code is good
run: task check
- name: Run unit tests
run: task test-unit
- name: Build the Agent for linux
run: task build
if: matrix.os == 'ubuntu-18.04'
# build the agent without GUI support (no tray icon)
- name: Build the Agent-cli
run: task build-cli
if: matrix.os == 'ubuntu-18.04'
# 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)
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
- name: Download tool to embed manifest in win binary
run: go get github.com/akavel/rsrc
if: matrix.os == 'windows-2019'
# building the agent for win requires a different task because of an extra flag
- name: Build the Agent for win32
env:
GOARCH: 386 # 32bit architecture (for support)
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)
run: task build-win
if: matrix.os == 'windows-2019' && matrix.arch == '-386'
- name: Build the Agent for win64
run: task build-win # GOARCH=amd64 by default on the runners
if: matrix.os == 'windows-2019' && matrix.arch == '-amd64'
- name: Build the Agent for macos
env:
MACOSX_DEPLOYMENT_TARGET: 10.11 # minimum supported version for mac
CGO_CFLAGS: -mmacosx-version-min=10.11
CGO_LDFLAGS: -mmacosx-version-min=10.11
run: task build
if: matrix.os == 'macos-10.15'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
if: matrix.os == 'macos-10.15'
- name: Run e2e tests
run: |
pip install poetry
task test-e2e
if: matrix.os == 'macos-10.15'
# this will create `public/` dir with compressed full bin (<version>/<os>-<arch>.gz) and a json file
- name: Create autoupdate files
run: go-selfupdate arduino-create-agent${{ matrix.ext }} ${TAG_VERSION}
if: matrix.arch != '-386' && steps.prerelease.outputs.IS_PRE != 'true'
- name: Create autoupdate files for win32
run: go-selfupdate -platform windows${{ matrix.arch }} arduino-create-agent${{ matrix.ext }} ${TAG_VERSION}
if: matrix.arch == '-386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true'
- name: Upload autoupdate files to Arduino downloads servers
run: |
aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.OLD_TARGET }}
if: steps.prerelease.outputs.IS_PRE != 'true'
# config.ini is required by the executable when it's run
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
path: |
arduino-create-agent*
config.ini
if-no-files-found: error
# The code-sign-mac-executable job will download the macos artifact from the previous job, sign e notarize the binary and re-upload it.
code-sign-mac-executable:
needs: build
strategy:
matrix: # to allow support for future architectures
os: [macos-10.15]
arch: [-amd64]
runs-on: ${{ matrix.os }}
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
path: arduino-create-agent
- name: Import Code-Signing Certificates
run: |
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > ${{ env.INSTALLER_CERT_MAC_PATH }}
security create-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
security default-keychain -s ${{ env.KEYCHAIN }}
security unlock-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
security import ${{ env.INSTALLER_CERT_MAC_PATH }} -k ${{ env.KEYCHAIN }} -f pkcs12 -A -T /usr/bin/codesign -P ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}
security set-key-partition-list -S apple-tool:,apple: -s -k ${{ secrets.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
- name: Install gon for code signing and app notarization
run: |
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.3/gon_macos.zip
unzip gon_macos.zip -d /usr/local/bin
- name: Write gon config to file
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
run: |
cat > gon.config.hcl <<EOF
source = ["arduino-create-agent/arduino-create-agent"]
bundle_id = "cc.arduino.arduino-agent"
sign {
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
}
# Ask Gon for zip output to force notarization process to take place.
# The CI will ignore the zip output, using the signed binary only.
zip {
output_path = "arduino-create-agent.zip"
}
EOF
- name: Code sign and notarize app
run: |
echo "gon will notarize executable in arduino-create-agent/arduino-create-agent"
gon -log-level=debug -log-json gon.config.hcl
timeout-minutes: 30
# This step will overwrite the non signed mac artifact (arduino-create-agent-${{ env.RUNS_ON }})
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
path: |
arduino-create-agent
!arduino-create-agent.zip
if-no-files-found: error
# This job is responsible for generating the installers (using installbuilder)
package:
needs: code-sign-mac-executable
runs-on: ubuntu-18.04
env:
# vars used by installbuilder
INSTALLBUILDER_PATH: "/opt/installbuilder-20.9.0/bin/builder"
INSTALLER_VARS: "project.outputDirectory=$PWD project.version=${GITHUB_REF##*/} workspace=$PWD realname=Arduino_Create_Agent"
# vars passed to installbuilder to install https certs automatically
CERT_INSTALL: "ask_certificates_install=CI" # win(edge),mac(safari)
NO_CERT_INSTALL: "ask_certificates_install=CS" # linux
CHOICE_CERT_INSTALL: "ask_certificates_install=CC" # win,mac:(ff,chrome)
CREATE_OSX_BUNDLED_MG: 0 # tell installbuilder to not create the DMG, gon will take care of that later
# installbuilder will read this vars automatically (defined in installer.xml):
INSTALLER_CERT_WINDOWS_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
INSTALLER_CERT_WINDOWS_PFX: "/tmp/ArduinoCerts2020.pfx"
INSTALLER_CERT_MAC_PASSWORD: ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}
INSTALLER_CERT_MAC_P12: "/tmp/ArduinoCerts2020.p12"
strategy:
fail-fast: false # if one os is failing continue nonetheless
matrix: # used to generate installers for different OS and not for runs-on
os: [ubuntu-18.04, windows-2019, macos-10.15]
arch: [-amd64]
include:
- os: ubuntu-18.04
install-builder-name: linux
executable-path: artifacts/linux-amd64/
- os: windows-2019
arch: -386
browser: edge
install-builder-name: windows
executable-path: artifacts/windows/
extension: .exe
installer-extension: .exe
- os: windows-2019
browser: edge
install-builder-name: windows
executable-path: artifacts/windows/
extension: .exe
installer-extension: .exe
- os: macos-10.15
browser: safari
install-builder-name: osx
executable-path: 'skel/ArduinoCreateAgent.app/Contents/MacOS/'
installer-extension: .app
container:
image: floydpink/ubuntu-install-builder:20.9.0
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: 'bcmi-labs/arduino-create-agent-installer' # the repo which contains install.xml
token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }}
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
path: ${{ matrix.executable-path }} # path expected by installbuilder
# zip artifacts do not mantain executable permission
- name: Make executable
run: chmod -v +x ${{ matrix.executable-path }}arduino-create-agent*
if: matrix.os == 'ubuntu-18.04' || matrix.os == 'macos-10.15'
- name: Rename executable to Arduino_Create_Agent
run: mv -v ${{ matrix.executable-path }}arduino-create-agent${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }}
- name: Rename executable to Arduino_Create_Agent_cli
run: mv -v ${{ matrix.executable-path }}arduino-create-agent_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }}
if: matrix.os == 'ubuntu-18.04'
- name: Save InstallBuilder license to file
run: echo "${{ secrets.INSTALLER_LICENSE }}" > /tmp/license.xml
- name: Save Win signing certificate to file
run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_PFX}}
if: matrix.os == 'windows-2019'
- name: Save macos signing certificate to file
run: echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > ${{ env.INSTALLER_CERT_MAC_P12 }}
if: matrix.os == 'macos-10.15'
# win(edge),mac(safari) -> CERT_INSTALL and win,mac:(ff,chrome) -> CHOICE_CERT_INSTALL
# installbuilder reads the env vars with certs paths and use it to sign the installer.
- name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL
run: |
${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CERT_INSTALL }}
mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-CI${{matrix.installer-extension}} ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-${{matrix.browser}}${{matrix.installer-extension}}
${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.CHOICE_CERT_INSTALL }}
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}}
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}}
rm -r ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}-installer-C*
if: matrix.os == 'windows-2019' || matrix.os == 'macos-10.15'
# linux
- name: Launch Bitrock installbuilder-20 with NO_CERT_INSTALL
run: |
${{ env.INSTALLBUILDER_PATH }} build installer.xml linux-x64 --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} ${{ env.NO_CERT_INSTALL }}
cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64-installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-chrome.run
mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64-installer-CS.run ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-firefox.run
cp -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64-installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-chrome.tar.gz
mv -v ArduinoCreateAgent-${GITHUB_REF##*/}-linux-x64-installer-CS.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-firefox.tar.gz
if: matrix.os == 'ubuntu-18.04'
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ArduinoCreateAgent-${{ matrix.install-builder-name }}${{ matrix.arch }}
path: ArduinoCreateAgent*
if-no-files-found: error
# This job will sign and notarize mac installers
code-sign-mac-installers:
needs: package
strategy:
matrix:
browser: [safari, firefox, chrome]
arch: [-amd64]
runs-on: macos-10.15
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ArduinoCreateAgent-osx${{ matrix.arch }}
path: ArduinoCreateAgent-osx
# zip artifacts do not mantain executable permission
- name: Make executable
run: chmod -v +x ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.app/Contents/MacOS/*
- name: Import Code-Signing Certificates
run: |
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > ${{ env.INSTALLER_CERT_MAC_PATH }}
security create-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
security default-keychain -s ${{ env.KEYCHAIN }}
security unlock-keychain -p ${{ secrets.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
security import ${{ env.INSTALLER_CERT_MAC_PATH }} -k ${{ env.KEYCHAIN }} -f pkcs12 -A -T /usr/bin/codesign -P ${{ secrets.INSTALLER_CERT_MAC_PASSWORD }}
security set-key-partition-list -S apple-tool:,apple: -s -k ${{ secrets.KEYCHAIN_PASSWORD }} ${{ env.KEYCHAIN }}
- name: Install gon for code signing and app notarization
run: |
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.3/gon_macos.zip
unzip gon_macos.zip -d /usr/local/bin
- name: Write gon config to file
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
run: |
cat > gon.config_installer.hcl <<EOF
source = ["ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.app"]
bundle_id = "cc.arduino.arduino-agent-installer"
sign {
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
}
dmg {
output_path = "ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.dmg"
volume_name = "ArduinoCreateAgent"
}
EOF
- name: Code sign and notarize app
run: |
echo "gon will notarize executable in ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.app"
gon -log-level=debug -log-json gon.config_installer.hcl
timeout-minutes: 30
# tar dmg file to keep executable permission
- name: Tar files to keep permissions
run: tar -cvf ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.tar ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.dmg
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ArduinoCreateAgent-osx${{ matrix.arch }}
path: ArduinoCreateAgent*.tar
if-no-files-found: error
create-release:
runs-on: ubuntu-18.04
needs: code-sign-mac-installers
steps:
- name: Download artifact
uses: actions/download-artifact@v2 # download all the artifacts
- name: Identify Prerelease
# This is a workaround while waiting for create-release action to implement auto pre-release based on tag
id: prerelease
run: |
curl -L -s https://github.com/fsaintjacques/semver-tool/archive/3.1.0.zip -o /tmp/3.1.0.zip
unzip -p /tmp/3.1.0.zip semver-tool-3.1.0/src/semver >/tmp/semver && chmod +x /tmp/semver
if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "::set-output name=IS_PRE::true"; fi
# mandatory step because upload-release-action does not support multiple folders
- name: prepare artifacts for the release
run: |
mkdir release
chmod -v +x ArduinoCreateAgent-linux-amd64/*.run
mv -v ArduinoCreateAgent-linux-amd64/* release/
cat ArduinoCreateAgent-osx-amd64/*.tar | tar -xvf - -i -C release/
rm -v release/._ArduinoCreateAgent*.dmg
mv -v ArduinoCreateAgent-windows*/* release/
- name: VirusTotal Scan
id: virustotal_step
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
update_release_body: false # `true` won't work because trigger type is not release
files: |
release/*.exe
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
arduino-create-agent-windows-2019-amd64/arduino-create-agent.exe
- name: Organize release body message #use sed to clean and format the output markdown style
id: release_body
run: |
vt_title_pre="<details close>\n<summary>VirusTotal analysis 🛡</summary>\n\n"
vt_links="$(echo ${{ steps.virustotal_step.outputs.analysis}} | sed 's/release\///g' | sed 's/,/\n/g' | sed 's/^/- [/' | sed 's/=/](/' | sed 's/$/)/')"
vt_title_post="\n</details>"
vt_title_pre="${vt_title_pre//'\n'/'%0A'}"
vt_links="${vt_links//$'\n'/'%0A'}" # replace \n with a special character -> generates a single lines, \n will be reintroduced later
vt_title_post="${vt_title_post//'\n'/'%0A'}"
echo "::set-output name=RBODY::$vt_title_pre$vt_links$vt_title_post"
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.release_body.outputs.RBODY}}
draft: false
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
- name: Upload release files on Github
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file_glob: true # If set to true, the file argument can be a glob pattern
file: release/*
- name: Upload release files on Arduino downloads servers
run: aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
if: steps.prerelease.outputs.IS_PRE != 'true'
- name: Update version file (used by frontend to trigger autoupdate and create filename)
run: |
echo {\"Version\": \"${GITHUB_REF##*/}\"} > /tmp/agent-version.json
aws s3 cp /tmp/agent-version.json s3://${{ env.VERSION_TARGET }}
if: steps.prerelease.outputs.IS_PRE != 'true'