Add pipeline step to upload packaged plugin to Factry Portal #13
Workflow file for this run
This file contains 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
# 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. | |
permissions: read-all | |
jobs: | |
release: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/pnpm | |
- uses: grafana/plugin-actions/build-plugin@release | |
with: | |
policy_token: ${{ secrets.GRAFANA_POLICY_TOKEN }} | |
- name: Get plugin metadata | |
id: metadata | |
run: | | |
sudo apt-get install jq | |
export GRAFANA_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id) | |
export GRAFANA_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version) | |
export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip | |
echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT | |
echo "plugin-version=${GRAFANA_PLUGIN_VERSION}" >> $GITHUB_OUTPUT | |
echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT | |
- name: Upload to Factry Portal | |
run: | | |
curl -X POST \ | |
-H "Authorization: Bearer ${{ secrets.FACTRY_PORTAL_PRODUCT_UPDATES_JWT_TOKEN }}" \ | |
-F "productType=${{steps.metadata.outputs.plugin-id }}" \ | |
-F "product=grafana-datasource" \ | |
-F "version=${{steps.metadata.outputs.plugin-version }}" \ | |
-F "binary=@${{ steps.metadata.outputs.archive }}" \ | |
--url "${{vars.FACTRY_PORTAL_PRODUCT_UPDATES_URL }}" |