Skip to content

Add changeset CLI integration #316

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 3 commits into from
Jan 27, 2025
Merged
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
29 changes: 29 additions & 0 deletions .changeset/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const changelogFunctions = {
getReleaseLine: async (changeset, type, options) => {
let prefix = '🎉';
if (type === 'major') {
prefix = '🎉';
} else if (type === 'minor') {
prefix = '🚀';
} else if (type === 'patch') {
prefix = '🐛';
}
if (changeset && changeset.summary) {
const summary = changeset.summary || '';
if (summary.indexOf('Docs') > -1) {
prefix = '📝';
}
if (summary.indexOf('Chore') > -1 || summary.indexOf('grafana-plugin-sdk-go') > -1 || summary.indexOf('compiled') > -1) {
prefix = '⚙️';
}
return [prefix, summary].join(' ');
}
return [prefix, changeset?.summary].join(' ');
},
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
return '\n';
},
};

module.exports = changelogFunctions;

11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": "./changelog.js",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ Make sure you have the following dependencies installed first:
mage -v
```

## Build a release for the Google BigQuery data source plugin
## Submitting PR

You need to have commit rights to the GitHub repository to publish a release.
If you are creating a PR, ensure to run `yarn changeset` from your branch. Provide the details accordingly. It will create `*.md` file inside `./.changeset` folder. Later during the release, based on these changesets, package version will be bumped and changelog will be generated.

## Releasing & Bumping version

To create a new release, execute `yarn changeset version`. This will update the Changelog and bump the version in `package.json` file. Commit those changes. Run the `Plugins - CD` GitHub Action to publish the new release.

1. Update the version number in the `package.json` file.
2. Update the `CHANGELOG.md` with the changes contained in the release.
3. Commit the changes to `main` branch and push to GitHub.
4. Follow the Drone release process that you can find [here](https://github.com/grafana/integrations-team/wiki/Plugin-Release-Process#drone-release-process)

# Plugin Technical Documentation

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@changesets/cli": "^2.27.12",
"@grafana/eslint-config": "^8.0.0",
"@grafana/plugin-e2e": "^1.16.0",
"@grafana/tsconfig": "^2.0.0",
Expand Down
Loading
Loading