From 1bacf1bc884efa8389eab731034c72dea5c2ba34 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 5 Dec 2024 22:28:36 +0000 Subject: [PATCH 1/5] Pin grafana/plugin-validator to v0.6.2 before go1.18 incompatibilites were introduced Signed-off-by: Dom Del Nano --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9fcac1..3f0346b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,7 +108,7 @@ 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 + git clone --branch v0.6.2 --depth 1 https://github.com/grafana/plugin-validator pushd ./plugin-validator/pkg/cmd/plugincheck go install popd From 799b786a24f54e24ddfe658020c6f7698edc28c7 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 5 Dec 2024 22:37:45 +0000 Subject: [PATCH 2/5] Try another version of plugin-validator Signed-off-by: Dom Del Nano --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f0346b..c656177 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,7 +108,7 @@ jobs: echo "::set-output name=checksum::$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" - name: Lint plugin run: | - git clone --branch v0.6.2 --depth 1 https://github.com/grafana/plugin-validator + git clone --branch v0.7.1 --depth 1 https://github.com/grafana/plugin-validator pushd ./plugin-validator/pkg/cmd/plugincheck go install popd From 23347ad9235036718ebe68ef1d28a3af3413ff73 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 5 Dec 2024 23:10:38 +0000 Subject: [PATCH 3/5] Use plugincheck2 Signed-off-by: Dom Del Nano --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c656177..4a5483d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -109,10 +109,10 @@ jobs: - name: Lint plugin run: | git clone --branch v0.7.1 --depth 1 https://github.com/grafana/plugin-validator - pushd ./plugin-validator/pkg/cmd/plugincheck + pushd ./plugin-validator/pkg/cmd/plugincheck2 go install popd - plugincheck ${{ steps.metadata.outputs.archive }} + plugincheck2 ${{ steps.metadata.outputs.archive }} - name: Create release id: create_release uses: actions/create-release@v1 From f8151064865b761e5a10e351b91d0f8617b083c0 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Thu, 5 Dec 2024 23:24:49 +0000 Subject: [PATCH 4/5] Ensure action has permission to write to GH release Signed-off-by: Dom Del Nano --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a5483d..37eaf42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,8 @@ on: jobs: release: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v2 From 77e867257dea060595be727d404f20e5060753fd Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Fri, 6 Dec 2024 00:07:27 +0000 Subject: [PATCH 5/5] Use softprops/action-gh-release Signed-off-by: Dom Del Nano --- .github/workflows/release.yml | 37 +++++++---------------------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37eaf42..54840ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - steps: - uses: actions/checkout@v2 @@ -110,6 +109,9 @@ jobs: echo "::set-output name=checksum::$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" - name: Lint plugin run: | + # 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 @@ -117,39 +119,14 @@ jobs: plugincheck2 ${{ steps.metadata.outputs.archive }} - name: Create release id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v2 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 .