Skip to content
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

Chore: Bump @grafana/create-plugin configuration to 5.5.3 #35

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .config/.cprc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "5.3.11"
"version": "5.5.3"
}
5 changes: 5 additions & 0 deletions .config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import path from 'path';
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin';
import { SubresourceIntegrityPlugin } from 'webpack-subresource-integrity';
import { type Configuration, BannerPlugin } from 'webpack';
import LiveReloadPlugin from 'webpack-livereload-plugin';
import VirtualModulesPlugin from 'webpack-virtual-modules';
Expand Down Expand Up @@ -180,6 +181,7 @@ const config = async (env): Promise<Configuration> => {
path: path.resolve(process.cwd(), DIST_DIR),
publicPath: `public/plugins/${pluginJson.id}/`,
uniqueName: pluginJson.id,
crossOriginLoading: 'anonymous',
},

plugins: [
Expand Down Expand Up @@ -229,6 +231,9 @@ const config = async (env): Promise<Configuration> => {
],
},
]),
new SubresourceIntegrityPlugin({
hashFuncNames: ['sha256'],
}),
...(env.development
? [
new LiveReloadPlugin(),
Expand Down
56 changes: 3 additions & 53 deletions .github/workflows/create-plugin-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,12 @@ name: Check and Update Create Plugin configs
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * 0'

jobs:
check_for_updates:
release:
runs-on: ubuntu-latest

steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Get latest version of the package
id: get-latest-version
run: echo "LATEST_VERSION=$(npx -y @grafana/create-plugin@latest version)" >> "$GITHUB_ENV"

- name: Checkout Repository
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_TOKEN }}

- name: Get version from .config/.cprc.json
id: get-config-version
run: |
CONFIG_VERSION=$(jq -r '.version' .config/.cprc.json)
echo "CONFIG_VERSION=${CONFIG_VERSION}" >> "$GITHUB_ENV"

- name: Compare versions
id: compare-versions
run: |
if [ "$LATEST_VERSION" != "$CONFIG_VERSION" ]; then
echo "update_needed=true" >> $GITHUB_OUTPUT
else
echo "update_needed=false" >> $GITHUB_OUTPUT
fi

- name: Update the configs
if: steps.compare-versions.outputs.update_needed == 'true'
run: |
npx -y @grafana/create-plugin@latest update
npm install

- name: Create PR
uses: peter-evans/create-pull-request@v6
if: steps.compare-versions.outputs.update_needed == 'true'
- uses: grafana/plugin-actions/create-plugin-update@jackw/create-plugin-update
with:
token: ${{ secrets.GH_PAT_TOKEN }}
branch: update-grafana-create-plugin
delete-branch: true
commit-message: 'chore: update configuration to create-plugin ${{ env.LATEST_VERSION }}'
title: 'Chore: Bump @grafana/create-plugin configuration to ${{ env.LATEST_VERSION }}'
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
body: |
Bumps [`@grafana/create-plugin`](https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin) configuration from ${{ env.CONFIG_VERSION }} to ${{ env.LATEST_VERSION }}.

**Notes for reviewer:**
This is an auto-generated PR which ran `npx -y @grafana/create-plugin@latest update`.
Please consult the create-plugin [CHANGELOG.md](https://github.com/grafana/plugin-tools/blob/main/packages/create-plugin/CHANGELOG.md) to understand what may have changed.
Please review the changes thoroughly before merging.
Loading
Loading