@@ -203,7 +203,7 @@ jobs:
203
203
echo "is-nightly=$is_nightly" >> $GITHUB_OUTPUT
204
204
echo "channel-name=$channel_name" >> $GITHUB_OUTPUT
205
205
# Only attempt upload to Amazon S3 if the credentials are available.
206
- echo "publish-to-s3=${{ secrets.AWS_SECRET_ACCESS_KEY != '' }}" >> $GITHUB_OUTPUT
206
+ echo "publish-to-s3=${{ secrets.AWS_ROLE_ARN != '' }}" >> $GITHUB_OUTPUT
207
207
208
208
select-targets :
209
209
needs : build-type-determination
@@ -284,8 +284,6 @@ jobs:
284
284
- build-type-determination
285
285
- select-targets
286
286
env :
287
- # https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
288
- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
289
287
# Location of artifacts generated by build.
290
288
BUILD_ARTIFACTS_PATH : electron-app/dist/build-artifacts
291
289
# to skip passing signing credentials to electron-builder
@@ -363,8 +361,6 @@ jobs:
363
361
AC_USERNAME : ${{ secrets.AC_USERNAME }}
364
362
AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
365
363
AC_TEAM_ID : ${{ secrets.AC_TEAM_ID }}
366
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
367
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
368
364
IS_NIGHTLY : ${{ needs.build-type-determination.outputs.is-nightly }}
369
365
IS_RELEASE : ${{ needs.build-type-determination.outputs.is-release }}
370
366
CAN_SIGN : ${{ secrets[matrix.config.certificate-secret] != '' }}
@@ -588,6 +584,12 @@ jobs:
588
584
env :
589
585
ARTIFACTS_FOLDER : build-artifacts
590
586
587
+ environment : production
588
+
589
+ permissions :
590
+ id-token : write
591
+ contents : read
592
+
591
593
steps :
592
594
- name : Download all job transfer artifacts
593
595
uses : actions/download-artifact@v4
@@ -596,15 +598,15 @@ jobs:
596
598
path : ${{ env.ARTIFACTS_FOLDER }}
597
599
pattern : ${{ env.JOB_TRANSFER_ARTIFACT_PREFIX }}*
598
600
601
+ - name : Configure AWS Credentials for Nightly [S3]
602
+ uses : aws-actions/configure-aws-credentials@v4
603
+ with :
604
+ role-to-assume : ${{ secrets.AWS_ROLE_ARN }}
605
+ aws-region : us-east-1
606
+
599
607
- name : Publish Nightly [S3]
600
- uses : docker://plugins/s3
601
- env :
602
- PLUGIN_SOURCE : ' ${{ env.ARTIFACTS_FOLDER }}/*'
603
- PLUGIN_STRIP_PREFIX : ' ${{ env.ARTIFACTS_FOLDER }}/'
604
- PLUGIN_TARGET : ' /arduino-ide/nightly'
605
- PLUGIN_BUCKET : ${{ secrets.DOWNLOADS_BUCKET }}
606
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
607
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
608
+ run : |
609
+ aws s3 sync ${{ env.ARTIFACTS_FOLDER }} s3://${{ secrets.DOWNLOADS_BUCKET }}/arduino-ide/nightly
608
610
609
611
release :
610
612
needs :
@@ -625,6 +627,12 @@ jobs:
625
627
env :
626
628
ARTIFACTS_FOLDER : build-artifacts
627
629
630
+ environment : production
631
+
632
+ permissions :
633
+ id-token : write
634
+ contents : read
635
+
628
636
steps :
629
637
- name : Download all job transfer artifacts
630
638
uses : actions/download-artifact@v4
@@ -648,16 +656,17 @@ jobs:
648
656
file_glob : true
649
657
body : ${{ needs.changelog.outputs.BODY }}
650
658
659
+ - name : Configure AWS Credentials for Release [S3]
660
+ if : needs.build-type-determination.outputs.publish-to-s3 == 'true'
661
+ uses : aws-actions/configure-aws-credentials@v4
662
+ with :
663
+ role-to-assume : ${{ secrets.AWS_ROLE_ARN }}
664
+ aws-region : us-east-1
665
+
651
666
- name : Publish Release [S3]
652
667
if : needs.build-type-determination.outputs.publish-to-s3 == 'true'
653
- uses : docker://plugins/s3
654
- env :
655
- PLUGIN_SOURCE : ' ${{ env.ARTIFACTS_FOLDER }}/*'
656
- PLUGIN_STRIP_PREFIX : ' ${{ env.ARTIFACTS_FOLDER }}/'
657
- PLUGIN_TARGET : ' /arduino-ide'
658
- PLUGIN_BUCKET : ${{ secrets.DOWNLOADS_BUCKET }}
659
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
660
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
668
+ run : |
669
+ aws s3 sync ${{ env.ARTIFACTS_FOLDER }} s3://${{ secrets.DOWNLOADS_BUCKET }}/arduino-ide
661
670
662
671
clean :
663
672
# This job must run after all jobs that use the transfer artifact.
0 commit comments