always render annotation component #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PROD Plugin Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --immutable --prefer-offline | |
| - name: Build and test frontend | |
| id: build | |
| run: yarn build | |
| - name: Sign plugin | |
| run: | | |
| export GRAFANA_ACCESS_POLICY_TOKEN=${{ secrets.GRAFANA_POLICY_TOKEN }} | |
| npx @grafana/sign-plugin@latest | |
| - name: Get plugin metadata | |
| id: metadata | |
| run: | | |
| sudo apt-get install jq | |
| export KENSOBI_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id) | |
| export KENSOBI_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version) | |
| export KENSOBI_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type) | |
| export KENSOBI_PLUGIN_ARTIFACT=${KENSOBI_PLUGIN_ID}-${KENSOBI_PLUGIN_VERSION}.zip | |
| export KENSOBI_PLUGIN_ARTIFACT_CHECKSUM=${KENSOBI_PLUGIN_ARTIFACT}.md5 | |
| echo "plugin-id=${KENSOBI_PLUGIN_ID}" >> $GITHUB_OUTPUT | |
| echo "plugin-version=${KENSOBI_PLUGIN_VERSION}" >> $GITHUB_OUTPUT | |
| echo "plugin-type=${KENSOBI_PLUGIN_TYPE}" >> $GITHUB_OUTPUT | |
| echo "archive=${KENSOBI_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT | |
| echo "archive-checksum=${KENSOBI_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT | |
| echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
| - name: Package plugin | |
| id: package-plugin | |
| run: | | |
| mv dist ${{ steps.metadata.outputs.plugin-id }} | |
| zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r | |
| md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }} | |
| echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT | |
| - name: Attest Build Provenance | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-path: ${{ steps.metadata.outputs.archive }} | |
| - name: Create Github release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.metadata.outputs.plugin-version }} | |
| draft: false | |
| generate_release_notes: true | |
| files: | | |
| ./${{ steps.metadata.outputs.archive }} | |
| ./${{ steps.metadata.outputs.archive-checksum }} | |
| body: | | |
| Release notes | |
| - name: Set up S3cmd cli tool | |
| uses: s3-actions/s3cmd@v1.2.0 | |
| with: | |
| provider: digitalocean | |
| access_key: ${{ secrets.SPACES_S3_ACCESS_KEY }} | |
| secret_key: ${{ secrets.SPACES_S3_SECRET_KEY }} | |
| region: nyc3 | |
| - name: Upload to Spaces | |
| run: | | |
| s3cmd put ${{ steps.metadata.outputs.archive }} --mime-type 'application/zip' --acl-public ${{ secrets.PLUGINS_PATH }}/prod/${{ steps.metadata.outputs.plugin-id }}.zip |