1 | # @semantic-release/changelog
|
2 |
|
3 | Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for creating or updating a changelog file.
|
4 |
|
5 | [![Travis](https://img.shields.io/travis/semantic-release/changelog.svg)](https://travis-ci.org/semantic-release/changelog)
|
6 | [![Codecov](https://img.shields.io/codecov/c/github/semantic-release/changelog.svg)](https://codecov.io/gh/semantic-release/changelog)
|
7 | [![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/changelog.svg)](https://greenkeeper.io/)
|
8 |
|
9 | [![npm latest version](https://img.shields.io/npm/v/@semantic-release/changelog/latest.svg)](https://www.npmjs.com/package/@semantic-release/changelog)
|
10 | [![npm next version](https://img.shields.io/npm/v/@semantic-release/changelog/next.svg)](https://www.npmjs.com/package/@semantic-release/changelog)
|
11 |
|
12 | ## verifyConditions
|
13 |
|
14 | Verify the `changelogFile` option configuration.
|
15 |
|
16 | ## prepare
|
17 |
|
18 | Create or update the changelog file in the local project repository.
|
19 |
|
20 | ## Configuration
|
21 |
|
22 | ### Options
|
23 |
|
24 | | Options | Description | Default |
|
25 | |-----------------|-----------------------------|----------------|
|
26 | | `changelogFile` | File path of the changelog. | `CHANGELOG.md` |
|
27 |
|
28 | ### Usage
|
29 |
|
30 | Options can be set within the plugin definition in the `semantic-release` configuration file:
|
31 |
|
32 | ```json
|
33 | {
|
34 | "release": {
|
35 | "prepare": [
|
36 | {
|
37 | "path": "@semantic-release/changelog",
|
38 | "changelogFile": "docs/changelog.md",
|
39 | },
|
40 | "@semantic-release/git"
|
41 | ]
|
42 | }
|
43 | }
|
44 | ```
|
45 |
|
46 | **It's recommended to use this plugin with the [git](https://github.com/semantic-release/git) plugin, so the changelog file will be committed to the Git repository and available on subsequent builds in order to be updated.**
|
47 |
|
48 | **When using with the [npm](https://github.com/semantic-release/npm) plugin and/or the [git](https://github.com/semantic-release/git) plugin the `changelog` plugin must be called first in order to create or update the changelog file, so it can be included in the npm package and committed to the Git repository.**
|
49 |
|
50 | To use with the [npm](https://github.com/semantic-release/npm) and [git](https://github.com/semantic-release/git) plugins:
|
51 |
|
52 | ```json
|
53 | {
|
54 | "release": {
|
55 | "verifyConditions": ["@semantic-release/changelog", "@semantic-release/npm", "@semantic-release/git"],
|
56 | "prepare": ["@semantic-release/changelog", "@semantic-release/npm", "@semantic-release/git"]
|
57 | }
|
58 | }
|
59 | ```
|