@@ -469,6 +469,14 @@ jobs:
469469 # errors due to race conditions with parallel branch runs should not fail the job
470470 extra/ci_calc_size_reports.py ${GITHUB_BASE_SHA} sketches-reports/ || true
471471
472+ # upload build metadata artifact, for upload to ci-builds
473+ - name : Archive build metadata information
474+ uses : actions/upload-artifact@v7
475+ with :
476+ name : build-metadata
477+ path : ${{ env.CORE_VER }}.json
478+ retention-days : 1
479+
472480 # upload comment request artifact (will be retrieved by leave_pr_comment.yml)
473481 - name : Archive comment information
474482 uses : actions/upload-artifact@v7
@@ -619,3 +627,56 @@ jobs:
619627 with :
620628 name : ArduinoCore-zephyr-${{ env.CORE_TAG }}-jsons
621629 path : ArduinoCore-*-${{ env.CORE_TAG }}.json
630+
631+ ci-builds-upload :
632+ runs-on : ubuntu-latest
633+ needs :
634+ - build-env
635+ - verify-core
636+ - prepare-json
637+ permissions :
638+ id-token : write # required to obtain the OIDC token
639+ env :
640+ CORE_TAG : ${{ needs.build-env.outputs.CORE_TAG }}
641+ CORE_VER : ${{ needs.build-env.outputs.CORE_VER }}
642+ steps :
643+ - uses : actions/download-artifact@v8
644+ with :
645+ path : platforms/
646+ name : ArduinoCore-zephyr-${{ env.CORE_TAG }}-jsons
647+
648+ - uses : actions/download-artifact@v8
649+ with :
650+ path : metadata/
651+ name : build-metadata
652+
653+ - run : |
654+ echo "SNIPPETS<<EOF" >> $GITHUB_ENV
655+ jq -cn 'reduce inputs as $i ({}; .[input_filename] = $i)' platforms/*.json metadata/*.json >> $GITHUB_ENV
656+ echo "EOF" >> $GITHUB_ENV
657+
658+ - name : Get OIDC identity token
659+ id : oidc
660+ uses : actions/github-script@v9
661+ with :
662+ script : |
663+ const token = await core.getIDToken('arduino/ci-builds');
664+ core.setOutput('token', token)
665+
666+ - name : Store snippets in ci-builds
667+ uses : actions/github-script@v9
668+ with :
669+ github-token : ${{ secrets.CI_BUILDS_TOKEN }}
670+ script : |
671+ await github.rest.actions.createWorkflowDispatch({
672+ owner: 'pillo79',
673+ repo: 'ci-builds',
674+ workflow_id: 'store-snippets.yml',
675+ ref: 'main',
676+ inputs: {
677+ oidc_token: '${{ steps.oidc.outputs.token }}',
678+ base_branch: '${{ needs.build-env.outputs.CORE_BRANCH }}',
679+ version: '${{ env.CORE_VER }}',
680+ snippets: '${{ env.SNIPPETS }}',
681+ },
682+ });
0 commit comments