Skip to content

Commit

Permalink
chore: release 2.0.2-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
wuda-io committed Jul 12, 2023
1 parent f613891 commit 3347651
Show file tree
Hide file tree
Showing 15 changed files with 5,760 additions and 5,581 deletions.
70 changes: 27 additions & 43 deletions FOR_MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# For Maintainers
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 😉.
This is the documentation that will be used by the maintainers. If you have ideas on how to do things better, please let us know by creating an issue or PR 😉.

- [Labels](#labels)
- [Releasing a new version](#releasing-a-new-version)
- [Generating CHANGELOG.md](#generating-changelogmd)

## Labels
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).

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
We have several labels that can be used to organize 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). 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

| Label | Section |
|---------------|--------------------------|
Expand All @@ -19,50 +17,36 @@ But there are important labels that are related to [changelog generation](#gener

## Releasing a new version
To fully release a new version, you need to have access to the @materializecss organization on the npmjs. Then, please follow the steps below:
1. Run `npm run release -- --oldver=<current_version> --newver=<new_version>`
> 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
> ```
> npm run release -- --oldver=1.0.0 --newver=1.1.0
> ```
2. Verify that version is correctly replaced in:

1. In your local copy of Materialize, step into the dev Branch with `git checkout v2-dev` and pull the newest version
with `git pull origin v2-dev` to have the newest version. Run Tests and check if everything works.

2. Make a new Release branch with `git checkout -b release-2.X.X-alpha`.
In case something happend or needs to be changed during the release it is better to keep the release on its own branch.

3. Run `npm run release -- --oldver=<current_version> --newver=<new_version>`
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 would be
```npm run release -- --oldver=1.0.0 --newver=1.1.0```

4. Verify that version is correctly replaced in:
* package.json
* src\global.ts
* the docs correctly shown the new version
3. DEPRECATED: Changelog is generated by GitHub [Then generate the CHANGELOG.md](#generating-changelogmd)
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
5. Merge the PR after most (hopefully everyone) happy with the planned release PR
6. Create a new release on GitHub
* With release notes from the generated CHANGELOG.md
* Upload the `materialize-v<new_vversion>.zip` from the bin folder
* Don't forget to create a new tag together with the release
7. Publish the release on npmjs
* If you never logged in on npm, please do `npm login` first and enter your credentials
* Then run `npm publish` and follow the instructions there
8. Done! Yay new version 🥳
* the docs* correctly show the new version `npm run dev`

## Generating CHANGELOG.md
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.
5. Add Commit with message "chore: release 2.X.X-alpha". Then push to server.

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.
6. Create a Pull Request (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

> I think this is noteworthy to mention it on their repo, maybe also fix it?
7. Create a new (draft) release on GitHub
* Generate the Release notes automatically
* Upload the `materialize-v<new_vversion>.zip` from the bin-folder
* Create a new tag together with the release

To make it easier, you can use Docker to run it. You can use the command below to get started.
8. Merge the Pull Request after 3 days if there are no concerns and all checks passed.
* Set the draft release to public.

```
docker run -it --rm \
-v "$(pwd)":/usr/local/src/your-app \
githubchangeloggenerator/github-changelog-generator \
-u materializecss \
-p materialize \
--base dontusehistorypls.md \
--since-tag 1.0.0 \
--token <your_GitHub_token> \
--no-issues \
--future-release 1.1.0 \
--bug-labels bug,bugfix \
--breaking-labels "breaking changes" \
--add-section '{"docs":{"labels":["documentation"],"prefix":"**Documentation changes:**"},"meta":{"labels":["build","meta"],"prefix":"**Meta changes:**"}}'
```
9. Publish the release on npmjs
* If you never logged in on npm, please do `npm login` first and enter your credentials
* Then run `npm publish` and follow the instructions there

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)
10. Done! Yay new version 🥳
Loading

0 comments on commit 3347651

Please sign in to comment.