-
Notifications
You must be signed in to change notification settings - Fork 11
Fix Grafana plugin release job #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1bacf1b
Pin grafana/plugin-validator to v0.6.2 before go1.18 incompatibilites…
ddelnano 799b786
Try another version of plugin-validator
ddelnano 23347ad
Use plugincheck2
ddelnano f815106
Ensure action has permission to write to GH release
ddelnano 77e8672
Use softprops/action-gh-release
ddelnano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,8 @@ on: | |
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
|
|
@@ -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 }} | ||
| - name: Create release | ||
| id: create_release | ||
| uses: actions/create-release@v1 | ||
| uses: softprops/action-gh-release@v2 | ||
|
Comment on lines
-118
to
+122
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| 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 . | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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: