Release #10
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
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
name: Create release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run: yarn install | |
- name: Build plugin | |
run: yarn build | |
#- name: Sign plugin | |
# run: yarn sign | |
# env: | |
# GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }} | |
- 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_TYPE=$(cat dist/plugin.json | jq -r .type) | |
export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip | |
export GRAFANA_PLUGIN_ARTIFACT_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.md5 | |
echo "::set-output name=plugin-id::${GRAFANA_PLUGIN_ID}" | |
echo "::set-output name=archive::${GRAFANA_PLUGIN_ARTIFACT}" | |
echo "::set-output name=archive-checksum::${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" | |
- 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 "::set-output name=checksum::$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" | |
ls -l | |
- name: Draft release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: | | |
${{ steps.metadata.outputs.archive }} | |
${{ steps.metadata.outputs.archive-checksum }} |