@@ -495,20 +495,88 @@ jobs:
495495 if : steps.run-e2e-tests.outcome != 'success' || steps.run-e2e-tests-min-version.outcome != 'success'
496496 run : exit 1
497497
498- publish-report :
499- if : ${{ always() && !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
500- needs : [generate-plugins]
501- runs-on : ubuntu-x64
498+ # TEMP DISABLED 2026-06-18: deploy-report-pages pushes an unsigned commit to gh-pages,
499+ # which will be rejected once unsigned commits are blocked. Re-enable once resolved.
500+ # publish-report:
501+ # if: ${{ always() && !cancelled() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) }}
502+ # needs: [generate-plugins]
503+ # runs-on: ubuntu-x64
504+ # permissions:
505+ # contents: write
506+ # pull-requests: write
507+ # steps:
508+ # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
509+ # with:
510+ # persist-credentials: false
511+ #
512+ # - name: Publish report
513+ # uses: grafana/plugin-actions/playwright-gh-pages/deploy-report-pages@376226a5245b6b8bbb95127241c430ef8d6aa643 # deploy-report-pages/v1.0.1
514+ # with:
515+ # github-token: ${{ secrets.GITHUB_TOKEN }}
516+ # retention-days: 7
517+
518+ release :
519+ runs-on : ubuntu-latest
520+ needs : [test, generate-plugins]
521+ if : |
522+ !contains(github.event.head_commit.message, 'ci skip')
523+ && !contains(github.event.head_commit.message, 'skip ci')
524+ && github.actor != 'dependabot[bot]'
525+ && github.event_name == 'push'
526+ && github.ref == 'refs/heads/main'
527+ name : Release packages
528+ env :
529+ NX_BRANCH : ${{ github.event.number || github.ref_name }}
502530 permissions :
503- contents : write
504- pull-requests : write
531+ contents : read
532+ id-token : write
505533 steps :
534+ - id : get-secrets
535+ uses : grafana/shared-workflows/actions/get-vault-secrets@f1614b210386ac420af6807a997ac7f6d96e477a # get-vault-secrets/v1.3.1
536+ with :
537+ # Secrets placed in the ci/repo/grafana/plugin-tools in vault
538+ repo_secrets : |
539+ SLACK_WEBHOOK_URL=slack_webhook_url:slack_webhook_url_fp
540+ NX_CLOUD_ACCESS_TOKEN=nx_token:nx_token
541+ export_env : false
542+
543+ # As recommended on NX docs the NX Cloud token should be set as an environment variable:
544+ # https://nx.dev/ci/recipes/security/access-tokens#setting-ci-access-tokens
545+ - id : add-nx-cloud-access-token-to-env
546+ run : |
547+ echo "NX_CLOUD_ACCESS_TOKEN=${{ fromJSON(steps.get-secrets.outputs.secrets).NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
548+
549+ - name : Generate token
550+ id : generate-token
551+ uses : grafana/shared-workflows/actions/create-github-app-token@259ba21cb3ff07724f331e26d926d655d24b317b # create-github-app-token/v0.2.3
552+ with :
553+ github_app : grafana-plugins-platform-bot
554+ permission_set : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && 'release' || 'default' }}
555+
506556 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
507557 with :
558+ token : ${{ steps.generate-token.outputs.token }}
508559 persist-credentials : false
509560
510- - name : Publish report
511- uses : grafana/plugin-actions/playwright-gh-pages/deploy-report-pages@376226a5245b6b8bbb95127241c430ef8d6aa643 # deploy-report-pages/v1.0.1
561+ - name : Prepare repository
562+ run : git fetch --unshallow --tags
563+
564+ - name : Setup nodejs
565+ uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
512566 with :
513- github-token : ${{ secrets.GITHUB_TOKEN }}
514- retention-days : 7
567+ node-version-file : ' .nvmrc'
568+ registry-url : ' https://registry.npmjs.org'
569+ # disabled caching to prevent a poisoned cache affecting releases.
570+ package-manager-cache : false
571+
572+ - name : Install dependencies
573+ run : npm ci --no-audit
574+
575+ - name : Build
576+ run : npm run build
577+
578+ - name : Create Release
579+ env :
580+ GITHUB_TOKEN : ${{ steps.generate-token.outputs.token }}
581+ SLACK_WEBHOOK_URL : ${{ fromJSON(steps.get-secrets.outputs.secrets).SLACK_WEBHOOK_URL }}
582+ run : npm run release
0 commit comments