Skip to content

Commit 26585e5

Browse files
authored
Changelog function (#63)
* Add changelog function to copy the releases * Update documentation for the changelog function
1 parent 5f7c3f1 commit 26585e5

File tree

7 files changed

+187
-229
lines changed

7 files changed

+187
-229
lines changed

.grenrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
"prefix": "v",
23
"ignoreIssuesWith": [
34
"duplicate",
45
"wontfix",

CHANGELOG.md

Lines changed: 76 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,141 @@
11
# Changelog
22

3-
## 0.6.3 (13/03/2017)
3+
## v0.7.2 (17/03/2017)
44

5-
- [**bug**] Fix multiple repo information [#48](https://github.com/github-tools/github-release-notes/issues/48)
5+
#### Bug Fixes:
66

7+
- [#59](https://github.com/github-tools/github-release-notes/issues/59) Changelog action doesn't work in the grunt task
78

8-
---
9+
---
910

10-
## 0.6.2 (13/03/2017)
11+
## v0.7.1 (16/03/2017)
1112

12-
- [**bug**] Remove unused option user.name [#45](https://github.com/github-tools/github-release-notes/issues/45)
13+
#### Bug Fixes:
1314

15+
- [#57](https://github.com/github-tools/github-release-notes/issues/57) Fix object-deep-assign bug
1416

17+
---
1518

16-
---
19+
## v0.7.0 (16/03/2017)
1720

18-
## 0.6.1 (12/03/2017)
21+
#### Framework Enhancements:
1922

20-
- [**bug**] Error when there is only one tag [#43](https://github.com/github-tools/github-release-notes/issues/43)
21-
- [**enhancement**] Use different files type for configuration [#39](https://github.com/github-tools/github-release-notes/issues/39)
23+
- [#53](https://github.com/github-tools/github-release-notes/issues/53) Allow functions as template values
24+
- [#50](https://github.com/github-tools/github-release-notes/issues/50) Add GIF in readme.md file
25+
- [#27](https://github.com/github-tools/github-release-notes/issues/27) Add possibility to change date format
2226

27+
---
2328

29+
## v0.3.3 (14/03/2017)
30+
*No changelog for this release.*
2431

25-
---
26-
27-
## 0.6.0 (11/03/2017)
32+
---
2833

29-
- [**enhancement**] Unwrap github-api promises [#32](https://github.com/github-tools/github-release-notes/issues/32)
30-
- [**bug**] Remove escaping character on regex [#29](https://github.com/github-tools/github-release-notes/issues/29)
31-
- [**enhancement**] Use external config file [#26](https://github.com/github-tools/github-release-notes/issues/26)
32-
- [**bug**] The changelog action doesn't compile latest release [#24](https://github.com/github-tools/github-release-notes/issues/24)
33-
- [**enhancement**] Introduce templates for the issues [#23](https://github.com/github-tools/github-release-notes/issues/23)
34-
- [**enhancement**] Add an "ignore label" flag [#19](https://github.com/github-tools/github-release-notes/issues/19)
35-
- [**enhancement**] Add the chance to rebuild the history of release notes [#12](https://github.com/github-tools/github-release-notes/issues/12)
34+
## v0.5.0 (14/03/2017)
3635

36+
#### Framework Enhancements:
3737

38+
- [#20](https://github.com/github-tools/github-release-notes/issues/20) Specify which tag to build
39+
- [#18](https://github.com/github-tools/github-release-notes/issues/18) Create global version of the module
40+
- [#16](https://github.com/github-tools/github-release-notes/issues/16) Update the documentation
41+
- [#14](https://github.com/github-tools/github-release-notes/issues/14) Add the chance to override the latest release body
42+
- [#13](https://github.com/github-tools/github-release-notes/issues/13) Check the network
43+
- [#11](https://github.com/github-tools/github-release-notes/issues/11) Add tests
44+
- [#10](https://github.com/github-tools/github-release-notes/issues/10) Use the issues as data source
45+
- [#9](https://github.com/github-tools/github-release-notes/issues/9) Get the information from the local git config
46+
- [#7](https://github.com/github-tools/github-release-notes/issues/7) Add the possibility to create a CHANGELOG file
3847

39-
---
48+
#### Bug Fixes:
4049

41-
## 0.5.0 (26/09/2016)
50+
- [#15](https://github.com/github-tools/github-release-notes/issues/15) Manage the scenario where there is only one tag
4251

43-
- [**enhancement**] Specify which tag to build [#20](https://github.com/github-tools/github-release-notes/issues/20)
44-
- [**enhancement**] Create global version of the module [#18](https://github.com/github-tools/github-release-notes/issues/18)
45-
- [**enhancement**] Update the documentation [#16](https://github.com/github-tools/github-release-notes/issues/16)
46-
- [**bug**] Manage the scenario where there is only one tag [#15](https://github.com/github-tools/github-release-notes/issues/15)
47-
- [**enhancement**] Add the chance to override the latest release body [#14](https://github.com/github-tools/github-release-notes/issues/14)
48-
- [**enhancement**] Check the network [#13](https://github.com/github-tools/github-release-notes/issues/13)
49-
- [**enhancement**] Add tests [#11](https://github.com/github-tools/github-release-notes/issues/11)
50-
- [**enhancement**] Use the issues as data source [#10](https://github.com/github-tools/github-release-notes/issues/10)
51-
- [**enhancement**] Get the information from the local git config [#9](https://github.com/github-tools/github-release-notes/issues/9)
52-
- [**enhancement**] Add the possibility to create a CHANGELOG file [#7](https://github.com/github-tools/github-release-notes/issues/7)
52+
---
5353

54+
## v0.6.1 (14/03/2017)
5455

56+
#### Framework Enhancements:
5557

56-
---
58+
- [#39](https://github.com/github-tools/github-release-notes/issues/39) Use different files type for configuration
5759

58-
## 0.4.0 (03/03/2016)
60+
#### Bug Fixes:
5961

60-
- [**enhancement**] Include various types of commit messages [#5](https://github.com/github-tools/github-release-notes/issues/5)
62+
- [#43](https://github.com/github-tools/github-release-notes/issues/43) Error when there is only one tag
6163

64+
---
6265

66+
## v0.6.2 (14/03/2017)
6367

64-
---
68+
#### Bug Fixes:
6569

66-
## 0.3.3 (26/01/2016)
70+
- [#45](https://github.com/github-tools/github-release-notes/issues/45) Remove unused option user.name
6771

68-
*No changelog for this release.*
72+
---
6973

74+
## v0.6.3 (14/03/2017)
7075

76+
#### Bug Fixes:
7177

72-
---
78+
- [#48](https://github.com/github-tools/github-release-notes/issues/48) Fix multiple repo information
7379

74-
## 0.3.2 (07/12/2015)
80+
---
7581

76-
*No changelog for this release.*
82+
## v0.4.0 (14/03/2017)
7783

84+
#### Framework Enhancements:
7885

86+
- [#5](https://github.com/github-tools/github-release-notes/issues/5) Include various types of commit messages
7987

80-
---
88+
---
8189

82-
## 0.3.1 (07/12/2015)
90+
## v0.6.0 (14/03/2017)
8391

84-
*No changelog for this release.*
92+
#### Framework Enhancements:
8593

94+
- [#32](https://github.com/github-tools/github-release-notes/issues/32) Unwrap github-api promises
95+
- [#26](https://github.com/github-tools/github-release-notes/issues/26) Use external config file
96+
- [#23](https://github.com/github-tools/github-release-notes/issues/23) Introduce templates for the issues
97+
- [#19](https://github.com/github-tools/github-release-notes/issues/19) Add an "ignore label" flag
98+
- [#12](https://github.com/github-tools/github-release-notes/issues/12) Add the chance to rebuild the history of release notes
8699

100+
#### Bug Fixes:
87101

88-
---
102+
- [#29](https://github.com/github-tools/github-release-notes/issues/29) Remove escaping character on regex
103+
- [#24](https://github.com/github-tools/github-release-notes/issues/24) The changelog action doesn't compile latest release
89104

90-
## 0.3.0 (19/11/2015)
105+
---
91106

107+
## v0.2.2 (10/03/2017)
92108
*No changelog for this release.*
93109

110+
---
94111

95-
96-
---
97-
98-
## 0.2.2 (18/11/2015)
99-
112+
## v0.3.0 (10/03/2017)
100113
*No changelog for this release.*
101114

115+
---
102116

117+
## v0.3.1 (10/03/2017)
118+
*No changelog for this release.*
103119

104-
---
105-
106-
## 0.2.1 (18/11/2015)
120+
---
107121

122+
## v0.3.2 (10/03/2017)
108123
*No changelog for this release.*
109124

125+
---
110126

127+
## v0.2.1 (26/09/2016)
128+
*No changelog for this release.*
111129

112-
---
113-
114-
## 0.2.0 (15/11/2015)
130+
---
115131

116-
- [**enhancement**] Cleanse option [#3](https://github.com/github-tools/github-release-notes/issues/3)
132+
## v0.2.0 (26/09/2016)
117133

134+
#### Framework Enhancements:
118135

136+
- [#3](https://github.com/github-tools/github-release-notes/issues/3) Cleanse option
119137

120-
---
138+
---
121139

122140
## v0.1.0 (12/11/2015)
123-
124141
_No changelog for this release._
125-
126-
127-
---
128-

docs/examples.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ You can group the issues in the release notes. So far the only way to group them
8888
An issue with no label will be included using the template option `no-label` (default "_closed_") as group name.
8989
To list all the issues that have any other label, use `"..."` as label name.
9090

91-
```json
91+
```javascript
9292
{
9393
"groupBy": {
9494
"Bug fixes:": ["bug"],
@@ -99,15 +99,15 @@ To list all the issues that have any other label, use `"..."` as label name.
9999

100100
### Changelog
101101

102-
There different ways to generate the changelog:
102+
The `changelog` action will generate a `CHANGELOG.md` file where you run the script. The content of the file will be generated in different ways, depending of the options you provide:
103103

104-
1. Get last release notes from github and prepend them to the `CHANGELOG.md` file.
104+
1. Get release notes from github releases, which you might have generated with this tool or not. _N.B. if the file exists already the script **won't** override it, unless you use the flag `--override`_
105105
```shell
106106
gren --action=changelog
107107
```
108-
2. Use all release notes from github and prepend them to the `CHANGELOG.md` file.
108+
2. Generate the release notes independently using the `gren` script. This will allows you to use all the [options]({{ "options#global-options" | relative_url }}) that the release script uses.
109109
```shell
110-
gren --action=changelog --time-wrap=history
110+
gren --action=changelog --generate --tags=all
111111
```
112112
3. Override existing release notes and generate new ones from the task and replace the `CHANGELOG.md` file.
113113
```shell
@@ -116,7 +116,7 @@ gren --action=changelog --time-wrap=history --override
116116

117117
You can also change the filename with the option `--changelog-filename`. For a complete reference, check the [options]({{ "options#changelog-options" | relative_url }}).
118118

119-
The changelog will look like this:
119+
The changelog will look like this (depending of your template configuration):
120120

121121
> # Changelog
122122
## v0.4.3 (02/03/2016)

docs/options.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Options
77
# Options
88

99
Below all the options for github-release-notes.
10-
You can find [Global options](#global-options), [Options for the release action](#release-options) and [Options for the changelog action](#changelog-options)
10+
You can find [Global options](#global-options), [Options for the release action](#release-options) and [Options for the changelog action](#changelog-options).
1111

1212
To use an option in your terminal, prefix it with `--` _(e.g. `gren --data-source=commits`)_
1313
To pass it to the `GithubReleaseNotes` class, in the [configuration file](#configuration-file) or in the [grunt task](https://github.com/github-tools/grunt-github-release-notes), they need to be `camelCase`.
@@ -19,27 +19,27 @@ To pass it to the `GithubReleaseNotes` class, in the [configuration file](#confi
1919
| `username` | **Required** | The username of the repo _e.g. `github-tools`_ | `null` |
2020
| `repo` | **Required** | The repository name _e.g. `github-release-notes`_ | `null` |
2121
| `action`| `release` `changelog` | The **gren** action to run. _(see details below for changelog generator)_ | `release` |
22+
| `tags` | `0.1.0` `0.2.0,0.1.0` `all` | A specific tag or the range of tags to build the release notes from. You can also specify `all` to write all releases. _(To override existing releases use the --override flag)_ | `false` |
2223
| `ignore-labels` | `wont_fix` `wont_fix,duplicate` | Ignore the specified labels. | `false` |
2324
| `ignore-issues-with` | `wont_fix` `wont_fix,duplicate` | Ignore issues that contains one of the specified labels. | `false` |
2425
| `data-source` | `issues` `commits` | The informations you want to use to build release notes. | `issues` |
2526
| `prefix` | **String** `e.g. v` | Add a prefix to the tag version. | `null` |
2627
| `override` | **Flag** | Override the release notes if existing. | `false` |
2728
| `include-messages` | `merge` `commits` `all` | Filter the messages added to the release notes. _Only used when `data-source` used is `commits` | `commits` |
29+
| `group-by` | `label` `{...}` | Group the issues using the labels as group headings. You can set custom headings for groups of labels. [See example]({{ "example#group-by" | relative_url }}) | `false` |
2830

2931
### Release options
3032

3133
| Command | Options | Description | Default |
3234
| ------- | ------- | ----------- | ------- |
3335
| `draft` | **Flag** | Set the release as a draft. | `false` |
3436
| `prerelease` | **Flag** | To set the release as a prerelease. | `false` |
35-
| `tags` | `0.1.0` `0.2.0,0.1.0` `all` | A specific tag or the range of tags to build the release notes from. You can also specify `all` to write all releases. _(To override existing releases use the --override flag)_ | `false` |
36-
| `group-by` | `label` `{...}` | Group the issues using the labels as group headings. You can set custom headings for groups of labels. [See example]({{ "example#group-by" | relative_url }}) | `false` |
3737

3838
### Changelog options
3939

4040
| Command | Options | Description | Default |
4141
| ------- | ------- | ----------- | ------- |
42-
| `time-wrap` | `latest` `history` | The release notes you want to include in the changelog. | `latest` |
42+
| `generate` | **Flag** | Generate the changelog with GithubReleaseNotes rather then using the repo releases | `false` |
4343
| `changelog-filename` | **String**, like `changelog.md` | The name of the changelog file. | `CHANGELOG.md` |
4444

4545
---
@@ -81,9 +81,12 @@ You can configure the output of **gren** using templates. Set your own configura
8181
"issue": "- {{labels}} {{name}} [{{text}}]({{url}})",
8282
"label": "[**{{label}}**]",
8383
"noLabel": "closed",
84-
"release": "## {{release}} {{date}}",
85-
"group": "#### {{heading}}\n"
84+
"group": "\n#### {{heading}}\n",
85+
"changelogTitle": "# Changelog\n\n",
86+
"release": "## {{release}} {{date}}\n{{body}}",
87+
"releaseSeparator": "\n---\n\n"
8688
}
89+
8790
}
8891
```
8992
{% endraw %}

0 commit comments

Comments
 (0)