5959 # URL to get source code for building the image
6060 IMAGE_SRC : https://github.com/radius-project/radius
6161
62- # bicep-types ACR url for uploading Radius Bicep types
63- BICEP_TYPES_REGISTRY : biceptypes.azurecr.io
64-
6562jobs :
6663 changes :
6764 name : Changes
@@ -356,15 +353,14 @@ jobs:
356353 helm push ${{ env.ARTIFACT_DIR }}/${{ env.HELM_PACKAGE_DIR }}/radius-${{ env.CHART_VERSION }}.tgz oci://${{ env.OCI_REGISTRY }}/${{ env.OCI_REPOSITORY }}
357354
358355 build-and-push-bicep-types :
359- name : Publish Radius bicep types to ACR
356+ name : Dispatch Bicep Types publish
360357 runs-on : ubuntu-24.04
361- timeout-minutes : 5
358+ timeout-minutes : 15
362359 needs : [changes]
363- if : needs.changes.outputs.only_changed != 'true'
360+ if : github.repository == 'radius-project/radius' && needs.changes.outputs.only_changed != 'true' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
364361 environment : publish-bicep
365362 permissions :
366363 contents : read # Required for actions/checkout
367- id-token : write # Required for azure/login
368364 steps :
369365 - name : Checkout
370366 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -379,49 +375,64 @@ jobs:
379375 - name : Parse release version and set environment variables
380376 run : python ./.github/scripts/get_release_version.py
381377
382- - name : Setup Go
383- uses : actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
384- with :
385- go-version-file : go.mod
386- cache-dependency-path : go.sum
387- cache : true
388-
389- - name : Setup Node.js
390- uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
378+ - name : Get App Token
379+ uses : actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
380+ id : get-token
391381 with :
392- node-version-file : .node-version
393-
394- - name : Generate Bicep extensibility types from OpenAPI specs
382+ app-id : ${{ secrets.RADIUS_PUBLISHER_BOT_APP_ID }}
383+ private-key : ${{ secrets.RADIUS_PUBLISHER_BOT_PRIVATE_KEY }}
384+ permission-metadata : read
385+ permission-actions : read
386+ permission-contents : write
387+ owner : azure-octo
388+ repositories : |
389+ radius-publisher
390+
391+ - name : Capture dispatch start time
392+ id : dispatch-start
393+ shell : bash
395394 run : |
396- make generate-bicep-types VERSION=${{ env.REL_CHANNEL == 'edge' && 'latest' || env.REL_CHANNEL }}
395+ echo "started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
397396
398- - name : Upload Radius Bicep types artifacts
399- uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
397+ - name : Repository Dispatch
398+ id : repository-dispatch
399+ uses : peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
400400 with :
401- name : radius-bicep-types
402- path : ./hack/bicep-types-radius/generated
403- if-no-files-found : error
404-
405- - name : Login via Azure CLI
406- if : github.repository == 'radius-project/radius' && ((startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'))
407- uses : azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
401+ token : ${{ steps.get-token.outputs.token }}
402+ repository : azure-octo/radius-publisher
403+ event-type : bicep-types
404+ client-payload : |-
405+ {
406+ "source_repository": "${{ github.repository }}",
407+ "source_ref": "${{ github.ref }}",
408+ "source_sha": "${{ github.sha }}",
409+ "rel_channel": "${{ env.REL_CHANNEL }}",
410+ "registry_target": "radius"
411+ }
412+
413+ - name : Monitor remote workflow
414+ id : monitor-remote-workflow
415+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
408416 with :
409- client-id : ${{ secrets.BICEPTYPES_CLIENT_ID }}
410- tenant-id : ${{ secrets.BICEPTYPES_TENANT_ID }}
411- subscription-id : ${{ secrets.BICEPTYPES_SUBSCRIPTION_ID }}
412-
413- - name : Setup and verify bicep CLI
414- if : github.repository == 'radius-project/radius' && ((startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'))
415- run : |
416- curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
417- chmod +x ./bicep
418- sudo mv ./bicep /usr/local/bin/bicep
419- bicep --version
420-
421- - name : Publish bicep types
422- if : github.repository == 'radius-project/radius' && ((startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'))
417+ github-token : ${{ steps.get-token.outputs.token }}
418+ script : |
419+ const { default: script } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/monitor-remote-workflow.mjs`)
420+ await script({context, github, core})
421+ env :
422+ INPUT_OWNER : azure-octo
423+ INPUT_REPO : radius-publisher
424+ INPUT_WORKFLOW_FILE : publish-bicep-types.yml
425+ INPUT_DISPATCH_STARTED_AT : ${{ steps.dispatch-start.outputs.started_at }}
426+ INPUT_MAX_WAIT_SECONDS : " 600"
427+ INPUT_POLL_INTERVAL_SECONDS : " 15"
428+
429+ - name : Show failed logs
430+ if : failure() && steps.monitor-remote-workflow.outputs.run_id != ''
431+ shell : bash
432+ env :
433+ GH_TOKEN : ${{ steps.get-token.outputs.token }}
423434 run : |
424- bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br: ${{ env.BICEP_TYPES_REGISTRY }}/radius:${{ env.REL_CHANNEL == 'edge' && 'latest' || env.REL_CHANNEL }} --force
435+ gh run view " ${{ steps.monitor-remote-workflow.outputs.run_id }}" --repo azure-octo /radius-publisher --log-failed || true
425436
426437 publish-release :
427438 name : Publish GitHub Release
0 commit comments