Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
elwills authored Feb 10, 2023
1 parent 8dedb69 commit 2205f3e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release:
runs-on: ubuntu-latest
env:
GRAFANA_API_KEY: $\{{ secrets.GRAFANA_API_KEY }}
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -56,12 +56,12 @@ jobs:
- name: Warn missing Grafana API key
run: |
echo Please generate a Grafana API key: https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#generate-an-api-key
echo Once done please follow the instructions found here: https://github.com/$\{{github.repository}}/blob/main/README.md#using-github-actions-release-workflow
if: $\{{ env.GRAFANA_API_KEY == '' }}
echo Once done please follow the instructions found here: https://github.com/${{github.repository}}/blob/main/README.md#using-github-actions-release-workflow
if: ${{ env.GRAFANA_API_KEY == '' }}

- name: Sign plugin
run: yarn sign
if: $\{{ env.GRAFANA_API_KEY != '' }}
if: ${{ env.GRAFANA_API_KEY != '' }}

- name: Get plugin metadata
id: metadata
Expand Down Expand Up @@ -89,43 +89,43 @@ jobs:
echo "path=release_notes.md" >> $GITHUB_OUTPUT
- name: Check package version
run: if [ "v${{ steps.metadata.outputs.plugin-version }}" != "$\{{ steps.metadata.outputs.github-tag }}" ]; then printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"; exit 1; fi
run: if [ "v${{ steps.metadata.outputs.plugin-version }}" != "${{ steps.metadata.outputs.github-tag }}" ]; then printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"; exit 1; fi

- 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
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: Validate plugin
run: |
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck2 -config ./plugin-validator/config/default.yaml $\{{ steps.metadata.outputs.archive }}
plugincheck2 -config ./plugin-validator/config/default.yaml ${{ steps.metadata.outputs.archive }}
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
files: |
./$\{{ steps.metadtata.outputs.archive }}
./$\{{ steps.metadata.outputs.archive-checksum }}
./${{ steps.metadtata.outputs.archive }}
./${{ steps.metadata.outputs.archive-checksum }}
body: |
**This Github draft release has been created for your plugin.**
If you would like to submit this release to Grafana please consider the following steps:
- Check the Validate plugin step in the [release wourkflow](https://gihub.com/$\{{github.repository}}/commit/$\{{github.sha}}/checks/$\{{github.run_id}}) for any warnings that need attention
- Check the Validate plugin step in the [release wourkflow](https://gihub.com/${{github.repository}}/commit/${{github.sha}}/checks/${{github.run_id}}) for any warnings that need attention
- Navigate to https://grafana.com/auth/sign-in/ to sign into your account
- Once logged in click **My Plugins** in the admin navigation
- Click the **Submit Plugin** button
- Fill in the Plugin Submission form:
- Paste this [.zip asset link](https://github.com/$\{{ github.repository }}/releases/download/v$\{{ steps.metadata.outputs.plugin-version }}/$\{{ steps.metadata.outputs.archive }}) in the Plugin URL field
- Paste this [.zip.md5 link](https://github.com/$\{{ github.repository }}/releases/download/v$\{{ steps.metadata.outputs.glugin-version }}/$\{{ steps.metadata.outputs.archive-checksum }}) in the MD5 field
- Paste this [.zip asset link](https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.plugin-version }}/${{ steps.metadata.outputs.archive }}) in the Plugin URL field
- Paste this [.zip.md5 link](https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.glugin-version }}/${{ steps.metadata.outputs.archive-checksum }}) in the MD5 field
Once done please remove these instructions and publish this release.

0 comments on commit 2205f3e

Please sign in to comment.