|
8 | 8 | DIST_DIR: dist
|
9 | 9 | # The project's folder on Arduino's download server for uploading builds
|
10 | 10 | AWS_PLUGIN_TARGET: TODO_AWS_PLUGIN_TARGET
|
| 11 | + AWS_REGION: "us-east-1" |
11 | 12 | ARTIFACT_NAME: dist
|
12 | 13 | # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
|
13 | 14 | GO_VERSION: "1.17"
|
@@ -181,9 +182,11 @@ jobs:
|
181 | 182 |
|
182 | 183 | create-release:
|
183 | 184 | runs-on: ubuntu-latest
|
| 185 | + environment: production |
184 | 186 | needs: notarize-macos
|
185 | 187 | permissions:
|
186 | 188 | contents: write
|
| 189 | + id-token: write # This is required for requesting the JWT |
187 | 190 |
|
188 | 191 | steps:
|
189 | 192 | - name: Download artifact
|
@@ -217,13 +220,14 @@ jobs:
|
217 | 220 | # NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem
|
218 | 221 | # (all the files we need are in the DIST_DIR root)
|
219 | 222 | artifacts: ${{ env.DIST_DIR }}/*
|
| 223 | + |
| 224 | + - name: configure aws credentials |
| 225 | + uses: aws-actions/configure-aws-credentials@v4 |
| 226 | + with: |
| 227 | + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} |
| 228 | + role-session-name: "github_${{ env.PROJECT_NAME }}" |
| 229 | + aws-region: ${{ env.AWS_REGION }} |
220 | 230 |
|
221 | 231 | - name: Upload release files on Arduino downloads servers
|
222 |
| - uses: docker://plugins/s3 |
223 |
| - env: |
224 |
| - PLUGIN_SOURCE: "${{ env.DIST_DIR }}/*" |
225 |
| - PLUGIN_TARGET: ${{ env.AWS_PLUGIN_TARGET }} |
226 |
| - PLUGIN_STRIP_PREFIX: "${{ env.DIST_DIR }}/" |
227 |
| - PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} |
228 |
| - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
229 |
| - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 232 | + run: aws s3 sync ${{ env.DIST_DIR }} s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }} |
| 233 | + |
0 commit comments