Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 12 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -108,46 +109,24 @@ jobs:
echo "::set-output name=checksum::$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)"
- name: Lint plugin
run: |
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck
# TODO(ddelnano): This should be removed once Go is upgraded to 1.21 or later
# This will also likely change when https://github.com/pixie-io/grafana-plugin/issues/106
# is resolved
git clone --branch v0.7.1 --depth 1 https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck ${{ steps.metadata.outputs.archive }}
plugincheck2 ${{ steps.metadata.outputs.archive }}
Comment on lines -115 to +119
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugincheck (v1) is deprecated and failed with the following error before I upgraded it:

~/work/grafana-plugin/grafana-plugin/plugin-validator/pkg/cmd/plugincheck ~/work/grafana-plugin/grafana-plugin
~/work/grafana-plugin/grafana-plugin

     888                                               888                888
     888                                               888                888
     888                                               888                888
 .d88888 .d88b. 88888b. 888d888 .d88b.  .d8888b 8888b. 888888 .d88b.  .d88888
d88" 888d8P  Y8b888 "88b888P"  d8P  Y8bd88P"       "88b888   d8P  Y8bd88" 888
888  88888888888888  888888    88888888888     .d888888888   88888888888  888
Y88b 888Y8b.    888 d88P888    Y8b.    Y88b.   888  888Y88b. Y8b.    Y88b 888
 "Y88888 "Y8888 88888P" 888     "Y8888  "Y8888P"Y888888 "Y888 "Y8888  "Y88888
                888
                888
                888

	**plugincheck V1 is no longer supported.**

	Use V2 instead: plugincheck2

	To install it see README https://github.com/grafana/plugin-validator



		You are running plugincheck in a Github Action.

		Replace your github action plugincheck-related code with the following:

		- name: Lint plugin
        run: |
          git clone https://github.com/grafana/plugin-validator
          pushd ./plugin-validator/pkg/cmd/plugincheck2
          go install
          popd
          plugincheck2 ${{ steps.metadata.outputs.archive }}

- name: Create release
id: create_release
uses: actions/create-release@v1
uses: softprops/action-gh-release@v2
Comment on lines -118 to +122
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub's actions/create-release has been deprecated since 2021. The softprops option is one of the recommended alternatives and handles the upload-plugin-asset and upload-checksum-asset steps as well.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: ${{ steps.changelog.outputs.path }}
files: |
${{ steps.metadata.outputs.archive }}
${{ steps.metadata.outputs.archive-checksum }}
draft: true

- name: Add plugin to release
id: upload-plugin-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.metadata.outputs.archive }}
asset_name: ${{ steps.metadata.outputs.archive }}
asset_content_type: application/zip

- name: Add checksum to release
id: upload-checksum-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.metadata.outputs.archive-checksum }}
asset_name: ${{ steps.metadata.outputs.archive-checksum }}
asset_content_type: text/plain

- name: Publish to Grafana.com
run: |
echo A draft release has been created for your plugin. Please review and publish it. Then submit your plugin to grafana.com/plugins by opening a PR to https://github.com/grafana/grafana-plugin-repository with the following entry:
echo
echo '{ "id": "${{ steps.metadata.outputs.plugin-id }}", "type": "${{ steps.metadata.outputs.plugin-type }}", "url": "https://github.com/${{ github.repository }}", "versions": [ { "version": "${{ steps.metadata.outputs.plugin-version }}", "commit": "${{ github.sha }}", "url": "https://github.com/${{ github.repository }}", "download": { "any": { "url": "https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.plugin-version }}/${{ steps.metadata.outputs.archive }}", "md5": "${{ steps.package-plugin.outputs.checksum }}" } } } ] }' | jq .
Loading