8
8
env :
9
9
# As defined by the Taskfile's PROJECT_NAME variable
10
10
PROJECT_NAME : arduino-create-agent
11
- TARGET : " /CreateAgent/Stable"
11
+ TARGET : " /CreateAgent/Stable/ "
12
12
OLD_TARGET : " /CreateBridge/" # compatibility with older releases (we can't change config.ini)
13
13
VERSION_TARGET : " arduino-create-static/agent-metadata/"
14
14
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
26
26
jobs :
27
27
# The build job is responsible for: configuring the environment, testing and compiling process
28
28
build :
29
+ outputs :
30
+ prerelease : ${{ steps.prerelease.outputs.IS_PRE }}
29
31
strategy :
30
32
matrix :
31
33
os : [ubuntu-20.04, windows-2019, macos-12]
@@ -204,13 +206,13 @@ jobs:
204
206
name : ArduinoCreateAgent.app
205
207
path : ArduinoCreateAgent.app.tar
206
208
207
- # The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it.
209
+ # The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it, uploading it also on s3 download servers for the autoupdate .
208
210
notarize-macos :
209
211
name : Notarize bundle
210
212
runs-on : macos-12
211
213
env :
212
214
GON_PATH : ${{ github.workspace }}/gon
213
- needs : create-macos-bundle
215
+ needs : [build, create-macos-bundle]
214
216
215
217
steps :
216
218
- name : Download artifact
@@ -276,6 +278,10 @@ jobs:
276
278
277
279
- name : Sign and notarize binary
278
280
run : gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"
281
+
282
+ - name : Upload autoupdate bundle to Arduino downloads servers
283
+ run : aws s3 cp ArduinoCreateAgent.app_notarized.zip s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}${GITHUB_REF/refs\/tags\//}/ # the version should be created in th the build job
284
+ if : ${{ needs.build.outputs.prerelease != 'true' }}
279
285
280
286
- name : Upload artifact
281
287
uses : actions/upload-artifact@v3
@@ -493,7 +499,7 @@ jobs:
493
499
494
500
create-release :
495
501
runs-on : ubuntu-20.04
496
- needs : code-sign-mac-installers
502
+ needs : [build, code-sign-mac-installers]
497
503
498
504
steps :
499
505
- name : Checkout
@@ -504,14 +510,6 @@ jobs:
504
510
- name : Download artifact
505
511
uses : actions/download-artifact@v3 # download all the artifacts
506
512
507
- - name : Identify Prerelease
508
- # This is a workaround while waiting for create-release action to implement auto pre-release based on tag
509
- id : prerelease
510
- run : |
511
- curl -L -s https://github.com/fsaintjacques/semver-tool/archive/3.1.0.zip -o /tmp/3.1.0.zip
512
- unzip -p /tmp/3.1.0.zip semver-tool-3.1.0/src/semver >/tmp/semver && chmod +x /tmp/semver
513
- if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "IS_PRE=true" >> $GITHUB_OUTPUT; fi
514
-
515
513
# mandatory step because upload-release-action does not support multiple folders
516
514
- name : prepare artifacts for the release
517
515
run : |
@@ -562,7 +560,7 @@ jobs:
562
560
release_name : ${{ github.ref }}
563
561
body : ${{ steps.release_body.outputs.RBODY}}
564
562
draft : false
565
- prerelease : ${{ steps.prerelease .outputs.IS_PRE }}
563
+ prerelease : ${{ needs.build .outputs.prerelease }}
566
564
567
565
- name : Upload release files on Github
568
566
uses : svenstaro/upload-release-action@v2
@@ -574,10 +572,10 @@ jobs:
574
572
575
573
- name : Upload release files on Arduino downloads servers
576
574
run : aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
577
- if : steps.prerelease .outputs.IS_PRE != 'true'
575
+ if : ${{ needs.build .outputs.prerelease != 'true' }}
578
576
579
577
- name : Update version file (used by frontend to trigger autoupdate and create filename)
580
578
run : |
581
579
echo {\"Version\": \"${GITHUB_REF##*/}\"} > /tmp/agent-version.json
582
580
aws s3 cp /tmp/agent-version.json s3://${{ env.VERSION_TARGET }}
583
- if : steps.prerelease .outputs.IS_PRE != 'true'
581
+ if : ${{ needs.build .outputs.prerelease != 'true' }}
0 commit comments