342342 type : boolean
343343
344344 # Options for testing the workflow itself.
345+ dist-artifacts-prefix :
346+ description : |
347+ Prefix to use when uploading the dist artifacts as GitHub artifacts.
348+ Can be used if multiple CI jobs can be run in parallel in the same repository, in order to avoid name clashes.
349+ For example: `my-plugin-`.
350+ type : string
351+ required : false
352+ default : " "
345353 DO-NOT-USE-allow-pinned-commit-hashes :
346354 description : |
347355 FOR INTERNAL TESTING ONLY, DO NOT USE.
350358 type : boolean
351359 required : false
352360 default : false
361+ DO-NOT-USE-gcom-api-url :
362+ description : |
363+ FOR INTERNAL TESTING ONLY, DO NOT USE.
364+ If set, overrides the GCOM API URL for all publish operations.
365+ Used for testing with mock GCOM servers.
366+ type : string
367+ required : false
368+ default : " "
353369
354370concurrency :
355371 group : cd-${{ github.head_ref || github.run_id }}
@@ -397,6 +413,7 @@ jobs:
397413 with :
398414 script : |
399415 const fs = require('fs');
416+ const path = require('path');
400417
401418 // Helper to get input/env values
402419 function getInput(name, fallback = '') {
@@ -411,6 +428,7 @@ jobs:
411428 const DISABLE_DOCS_PUBLISHING = getInput('DISABLE_DOCS_PUBLISHING') === 'true';
412429 const PLUGIN_VERSION_SUFFIX = getInput('PLUGIN_VERSION_SUFFIX', '');
413430 const COMMIT_SHA = getInput('COMMIT_SHA');
431+ const PLUGIN_DIRECTORY = getInput('PLUGIN_DIRECTORY');
414432
415433 // Determine if the reference is a release one (allowed to publish to prod)
416434 let isReleaseReference = false;
@@ -426,7 +444,7 @@ jobs:
426444 // has-backend is also returned by the ci job, but we do the check here again
427445 // so we don't have to depend on the ci job.
428446 // The ci workflow uses this same check to determine if the plugin has a backend.
429- const hasBackend = fs.existsSync('Magefile.go');
447+ const hasBackend = fs.existsSync(path.join(PLUGIN_DIRECTORY, 'Magefile.go') );
430448 let platforms = ['any'];
431449 if (hasBackend) {
432450 platforms = ['linux', 'darwin', 'windows', 'any'];
@@ -540,6 +558,7 @@ jobs:
540558 DISABLE_DOCS_PUBLISHING : ${{ inputs.disable-docs-publishing }}
541559 COMMIT_SHA : ${{ steps.checkout-specified-branch.outputs.commit }}
542560 PLUGIN_VERSION_SUFFIX : ${{ inputs.plugin-version-suffix }}
561+ PLUGIN_DIRECTORY : ${{ inputs.plugin-directory }}
543562
544563 ci :
545564 name : CI
@@ -588,6 +607,7 @@ jobs:
588607 allow-unsigned : ${{ inputs.allow-unsigned }}
589608 signature-type : ${{ inputs.signature-type }}
590609
610+ dist-artifacts-prefix : ${{ inputs.dist-artifacts-prefix }}
591611 DO-NOT-USE-allow-pinned-commit-hashes : ${{ inputs.DO-NOT-USE-allow-pinned-commit-hashes }}
592612
593613 build-attestation :
@@ -606,7 +626,7 @@ jobs:
606626 - name : Download GitHub artifact
607627 uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
608628 with :
609- name : dist-artifacts
629+ name : ${{ inputs.dist-artifacts-prefix }} dist-artifacts
610630 path : /tmp/dist-artifacts
611631
612632 - name : Generate artifact attestation
@@ -698,15 +718,18 @@ jobs:
698718 ENVIRONMENT : ${{ matrix.environment }}
699719
700720 - name : Check and create stub
721+ id : check-and-create-stub
701722 uses : grafana/plugin-ci-workflows/actions/internal/plugins/publish/check-and-create-stub@main
702723 if : ${{ matrix.environment != 'prod' && matrix.environment != 'prod-canary' }}
703724 with :
704725 plugin-id : ${{ fromJSON(needs.ci.outputs.plugin).id }}
705726 environment : ${{ matrix.environment }}
706727 gcom-publish-token : ${{ env.GCOM_PUBLISH_TOKEN }}
707728 gcloud-auth-token : ${{ steps.gcloud.outputs.id_token }}
729+ gcom-api-url : ${{ inputs.DO-NOT-USE-gcom-api-url }}
708730
709731 - name : Check artifact ZIP(s)
732+ id : check-artifact-zips
710733 uses : grafana/plugin-ci-workflows/actions/internal/plugins/publish/check-artifacts@main
711734 with :
712735 zips : ${{ needs.upload-to-gcs-release.outputs.gcs-zip-urls }}
@@ -722,6 +745,7 @@ jobs:
722745 gcloud-auth-token : ${{ steps.gcloud.outputs.id_token }}
723746 ignore-conflicts : ${{ steps.determine-continue.outputs.ignore_conflicts }}
724747 publish-as-pending : ${{ matrix.environment == 'prod-canary' || inputs.publish-to-catalog-as-pending }}
748+ gcom-api-url : ${{ inputs.DO-NOT-USE-gcom-api-url }}
725749
726750 - name : Print publish summary
727751 run : |
@@ -824,7 +848,7 @@ jobs:
824848 - name : Download GitHub artifact
825849 uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
826850 with :
827- name : dist-artifacts
851+ name : ${{ inputs.dist-artifacts-prefix }} dist-artifacts
828852 path : /tmp/dist-artifacts
829853
830854 - name : Prepare "latest" artifacts
@@ -843,6 +867,7 @@ jobs:
843867 service_account : github-plugin-ci-workflows@grafanalabs-workload-identity.iam.gserviceaccount.com
844868
845869 - name : " Set up Cloud SDK"
870+ id : gcloud-sdk
846871 uses : " google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db" # v3.0.1
847872 with :
848873 version : " >= 363.0.0"
@@ -1059,7 +1084,7 @@ jobs:
10591084 - name : Download GitHub artifact
10601085 uses : actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
10611086 with :
1062- name : dist-artifacts
1087+ name : ${{ inputs.dist-artifacts-prefix }} dist-artifacts
10631088 path : /tmp/dist-artifacts
10641089
10651090 - name : Parse changelog
0 commit comments