|
| 1 | +# For Maintainers |
| 2 | +This is the documentation that will be used by the maintainers. If you have any better idea on how to do things better, please let us know by creating an issue or PR 😉. |
| 3 | + |
| 4 | +- [Labels](#labels) |
| 5 | +- [Releasing a new version](#releasing-a-new-version) |
| 6 | +- [Generating CHANGELOG.md](#generating-changelogmd) |
| 7 | + |
| 8 | +## Labels |
| 9 | +We have several labels that we can use to organize the issues and PRs on this repo, and also to make the changelog generation easier. All the labels and their descriptions can be [read here](https://github.com/materializecss/materialize/issues/labels). |
| 10 | + |
| 11 | +But there are important labels that are related to [changelog generation](#generating-changelogmd), which will determine where all the merged PRs end up. Any other PRs that hasn't labeled with one of these will not be shown on the changelog. Please take a look at the table below |
| 12 | + |
| 13 | +| Label | Section | |
| 14 | +|---------------|--------------------------| |
| 15 | +| enhancement | Implemented enhancements | |
| 16 | +| bug | Fixed bugs | |
| 17 | +| documentation | Documentation changes | |
| 18 | +| meta | Meta changes | |
| 19 | + |
| 20 | +## Releasing a new version |
| 21 | +To fully release a new version, you need to have access to the @materializecss organization on the npmjs. Then, please follow the steps below: |
| 22 | +1. Run `npm run release -- --oldver=<current_version> --newver=<new_version>` |
| 23 | + > What this command does is that it will replace any occurrences of "<current_version>" with the "<new_version>". So for example, if the current release is `1.0.0`, and then the planned release is `1.1.0`, the command is |
| 24 | + > ``` |
| 25 | + > npm run release -- --oldver=1.0.0 --newver=1.1.0 |
| 26 | + > ``` |
| 27 | +2. Verify that version is correctly replaced in: |
| 28 | + * package.json |
| 29 | + * js\global.js |
| 30 | + * the docs correctly shown the new version |
| 31 | +3. [Then generate the CHANGELOG.md](#generating-changelogmd) |
| 32 | +4. Create a PR ([example](https://github.com/materializecss/materialize/pull/258) so that we can verify nothing goes wrong, address the feedback from the reviewers if there is any |
| 33 | +5. Merge the PR after most (hopefully everyone) happy with the planned release PR |
| 34 | +6. Create a new release on GitHub |
| 35 | + * With release notes from the generated CHANGELOG.md |
| 36 | + * Upload the `materialize-v<new_vversion>.zip` from the bin folder |
| 37 | + * Don't forget to create a new tag together with the release |
| 38 | +7. Publish the release on npmjs |
| 39 | + * If you never logged in on npm, please do `npm login` first and enter your credentials |
| 40 | + * Then run `npm publish` and follow the instructions there |
| 41 | +8. Done! Yay new version 🥳 |
| 42 | +
|
| 43 | +## Generating CHANGELOG.md |
| 44 | +To generate the CHANGELOG.md, we will use [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator) to automatically generate it. The changelog will be generated based on merged PRs. So if you have any changes that need to be mentioned on release notes, please avoid commit it directly to the main branch, and do create a PR for it. |
| 45 | +
|
| 46 | +Also it's important that if you want to merge the PR, **please use "merge and commit", do not squash**. Because for some reason the generator can't recognize the squashed PRs. |
| 47 | +
|
| 48 | +> I think this is noteworthy to mention it on their repo, maybe also fix it? |
| 49 | +
|
| 50 | +To make it easier, you can use Docker to run it. You can use the command below to get started. |
| 51 | +
|
| 52 | +``` |
| 53 | +docker run -it --rm \ |
| 54 | + -v "$(pwd)":/usr/local/src/your-app \ |
| 55 | + githubchangeloggenerator/github-changelog-generator \ |
| 56 | + -u materializecss \ |
| 57 | + -p materialize \ |
| 58 | + --base dontusehistorypls.md \ |
| 59 | + --since-tag 1.0.0 \ |
| 60 | + --token <your_GitHub_token> \ |
| 61 | + --no-issues \ |
| 62 | + --future-release 1.1.0 \ |
| 63 | + --bug-labels bug,bugfix \ |
| 64 | + --breaking-labels "breaking changes" \ |
| 65 | + --add-section '{"docs":{"labels":["documentation"],"prefix":"**Documentation changes:**"},"meta":{"labels":["build","meta"],"prefix":"**Meta changes:**"}}' |
| 66 | +``` |
| 67 | +
|
| 68 | +Btw, the `--token` param is optional. But since GitHub API has rate limitations for unauthenticated requests, I recommend you to use the token. [You can follow the instructions from their repo.](https://github.com/github-changelog-generator/github-changelog-generator#github-token) |
0 commit comments