|
8 | 8 | DIST_DIR: dist
|
9 | 9 | # The project's folder on Arduino's download server for uploading builds
|
10 | 10 | AWS_PLUGIN_TARGET: /discovery/mdns-discovery/
|
| 11 | + AWS_REGION: "us-east-1" |
11 | 12 | ARTIFACT_PREFIX: dist-
|
12 | 13 |
|
13 | 14 | on:
|
@@ -185,7 +186,10 @@ jobs:
|
185 | 186 |
|
186 | 187 | create-release:
|
187 | 188 | runs-on: ubuntu-latest
|
| 189 | + environment: production |
188 | 190 | needs: notarize-macos
|
| 191 | + permissions: |
| 192 | + id-token: write # This is required for requesting the JWT |
189 | 193 |
|
190 | 194 | steps:
|
191 | 195 | - name: Download artifact
|
@@ -229,12 +233,12 @@ jobs:
|
229 | 233 | # (all the files we need are in the DIST_DIR root)
|
230 | 234 | artifacts: ${{ env.DIST_DIR }}/*
|
231 | 235 |
|
| 236 | + - name: configure aws credentials |
| 237 | + uses: aws-actions/configure-aws-credentials@v4 |
| 238 | + with: |
| 239 | + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} |
| 240 | + role-session-name: "github_${{ env.PROJECT_NAME }}" |
| 241 | + aws-region: ${{ env.AWS_REGION }} |
| 242 | + |
232 | 243 | - name: Upload release files on Arduino downloads servers
|
233 |
| - uses: docker://plugins/s3 |
234 |
| - env: |
235 |
| - PLUGIN_SOURCE: "${{ env.DIST_DIR }}/*" |
236 |
| - PLUGIN_TARGET: ${{ env.AWS_PLUGIN_TARGET }} |
237 |
| - PLUGIN_STRIP_PREFIX: "${{ env.DIST_DIR }}/" |
238 |
| - PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} |
239 |
| - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
240 |
| - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 244 | + run: aws s3 sync ${{ env.DIST_DIR }} s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }} |
0 commit comments