@@ -219,36 +219,71 @@ jobs:
219219 overwrite : true
220220 path : ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
221221
222+ checksums :
223+ needs : notarize-macos
224+ runs-on : ubuntu-latest
225+ permissions :
226+ contents : read
227+ 228+ steps :
229+ - name : Set environment variables
230+ run : |
231+ # See: https://docs.github.com/actions/reference/workflows-and-actions/workflow-commands#setting-an-environment-variable
232+ TAG="nightly-$(date -u +"%Y%m%d")"
233+ echo "CHECKSUM_FILE_PATH=${{ runner.temp }}/${TAG}-checksums.txt" >>"$GITHUB_ENV"
234+ echo "TAG=$TAG" >>"$GITHUB_ENV"
235+
236+ - name : Download artifacts
237+ uses : actions/download-artifact@v6
238+ with :
239+ merge-multiple : true
240+ path : ${{ env.DIST_DIR }}
241+ pattern : ${{ env.ARTIFACT_PREFIX }}*
242+ 243+ - name : Create checksum file
244+ working-directory : ${{ env.DIST_DIR }}
245+ run : |
246+ sha256sum ${{ env.PROJECT_NAME }}_${{ env.TAG }}* >"${{ env.CHECKSUM_FILE_PATH }}"
247+
248+ - name : Upload checksum artifact
249+ uses : actions/upload-artifact@v5
250+ with :
251+ if-no-files-found : error
252+ name : ${{ env.ARTIFACT_PREFIX }}checksums
253+ path : ${{ env.CHECKSUM_FILE_PATH }}
254+ 222255 publish-nightly :
223256 runs-on : ubuntu-latest
224257 environment : production
225- needs : notarize-macos
258+ needs : checksums
226259 permissions :
227260 contents : write
228261 id-token : write # This is required for requesting the JWT
229262
230263 steps :
264+ - name : Determine whether publishing to AWS is possible
265+ id : aws-determination
266+ run : |
267+ echo "publish=${{ secrets.AWS_ROLE_TO_ASSUME != '' }}" >>$GITHUB_OUTPUT
268+
231269 - name : Download artifact
270+ if : steps.aws-determination.outputs.publish == 'true'
232271 uses : actions/download-artifact@v6
233272 with :
234273 pattern : ${{ env.ARTIFACT_PREFIX }}*
235274 merge-multiple : true
236275 path : ${{ env.DIST_DIR }}
237276
238- - name : Create checksum file
239- working-directory : ${{ env.DIST_DIR }}
240- run : |
241- TAG="nightly-$(date -u +"%Y%m%d")"
242- sha256sum ${{ env.PROJECT_NAME }}_${TAG}* >${TAG}-checksums.txt
243-
244277 - name : configure aws credentials
278+ if : steps.aws-determination.outputs.publish == 'true'
245279 uses : aws-actions/configure-aws-credentials@v5
246280 with :
247281 role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
248282 role-session-name : " github_${{ env.PROJECT_NAME }}"
249283 aws-region : ${{ env.AWS_REGION }}
250284
251285 - name : Upload release files on Arduino downloads servers
286+ if : steps.aws-determination.outputs.publish == 'true'
252287 run : |
253288 aws s3 sync \
254289 ${{ env.DIST_DIR }} \
0 commit comments