Skip to content

0.0.11

0.0.11 #23

Workflow file for this run

# This GitHub Action automates the process of building Grafana plugins.
# (For more information, see https://github.com/grafana/plugin-actions/blob/main/build-plugin/README.md)
name: Release
on:
push:
tags:
- 'v*' # Run workflow on version tags, e.g. v1.0.0.
workflow_dispatch:
# inputs:
# target_dev:
# description: "Publish to dev"
# required: true
# type: boolean
# default: false
# target_ops:
# description: "Publish to ops"
# required: true
# type: boolean
# default: false
# target_prod:
# description: "Publish to prod"
# required: true
# type: boolean
# default: false
# pull_request:
# branches:
# - main
# paths:
# - ".github/workflows/release.yml"
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: grafana/plugin-actions/build-plugin@main
id: build-release
with:
policy_token: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
- name: Get plugin metadata
id: metadata
run: |
sudo apt-get install jq
export GRAFANA_PLUGIN_ID=$(cat src/plugin.json | jq -r .id)
export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-latest.zip
echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT
echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT
- id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
common_secrets: |
GCP_UPLOAD_ARTIFACTS_KEY=grafana/integration-artifacts-uploader-service-account:'credentials.json'
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ env.GCP_UPLOAD_ARTIFACTS_KEY }}
- id: 'create-latest'
run: cp ${{ steps.build-release.outputs.archive }} ${{ steps.metadata.outputs.archive }}
- id: 'upload-to-gcs'
name: 'Upload assets to latest'
uses: 'google-github-actions/upload-cloud-storage@v1'
with:
path: ./
destination: 'integration-artifacts/grafana-exploretraces-app/'
glob: '*.zip'
parent: false
publish:
needs: [release]
strategy:
fail-fast: false
matrix:
# environment: ["dev", "ops", "prod"]
environment: ["dev"]
# exclude:
# - environment: ${{ !inputs.target_dev && 'dev' }}
# - environment: ${{ !inputs.target_ops && 'ops' }}
# - environment: ${{ !inputs.target_prod && 'prod' }}
environment: ${{ matrix.environment }}
runs-on: ubuntu-latest
container:
image: grafana/integration-grafana-publisher:v11
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Auth with Google service account for bypassing IAP
uses: "google-github-actions/auth@v2"
id: gcloud-iap-auth
if: ${{ matrix.environment != 'prod' }}
with:
project_id: ${{ vars.GOOGLE_IAP_PROJECT_ID }}
token_format: id_token
workload_identity_provider: projects/304398677251/locations/global/workloadIdentityPools/github/providers/github-provider
service_account: ${{ vars.GOOGLE_IAP_SERVICE_ACCOUNT }}
id_token_audience: 194555723165-aftshfqa32nig79trcrh96ha94ta46jd.apps.googleusercontent.com
id_token_include_email: true
create_credentials_file: false
export_environment_variables: false
- name: Publish new plugin version on grafana.com
working-directory: plugins/grafana-exploretraces-app
shell: bash
env:
GCOM_API_PLUGINS: ${{ vars.GRAFANA_BASE_URL }}/api/plugins
GCOM_IAP_TOKEN: ${{ steps.gcloud-iap-auth.outputs.id_token }}
GCOM_PUBLISH_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
GITHUB_TOKEN: $GITHUB_TOKEN
run: |
PLUGIN_ID=`jq -r .id src/plugin.json`
VERSION=`jq -r .version package.json`
GCLOUD_SERVICE_KEY=$(echo ${{ env.GCP_UPLOAD_ARTIFACTS_KEY }} | base64 -d) /root/app/bin/grafana-publisher.js --auto --dryrun publish-from-monorepo $PLUGIN_ID $VERSION ${{github.server_url}}/${{ github.repository }} ${{ github.sha }} ${{ matrix.environment == 'prod' && 'release' || format('release-{0}', matrix.environment) }}