UNPKG

3.4 kBMarkdownView Raw
1# @semantic-release/changelog
2
3[**semantic-release**](https://github.com/semantic-release/semantic-release) plugin to create or update 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| Step | Description |
13|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14| `verifyConditions` | Verify the `changelogFile` and `changelogTitle` options configuration. |
15| `prepare` | Create or update a changelog file in the local project directory with the changelog content created in the [generate notes step](https://github.com/semantic-release/semantic-release#release-steps). |
16
17## Install
18
19```bash
20$ npm install @semantic-release/changelog -D
21```
22
23## Usage
24
25The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/configuration.md#configuration):
26
27```json
28{
29 "plugins": [
30 "@semantic-release/commit-analyzer",
31 "@semantic-release/release-notes-generator",
32 ["@semantic-release/changelog", {
33 "changelogFile": "docs/CHANGELOG.md",
34 }],
35 "@semantic-release/git",
36 ]
37}
38```
39
40With this example, for each release, a `docs/CHANGELOG.md` will be created or updated.
41
42## Configuration
43
44### Options
45
46| Options | Description | Default |
47|------------------|-------------------------------------------------------|----------------|
48| `changelogFile` | File path of the changelog. | `CHANGELOG.md` |
49| `changelogTitle` | Title of the changelog file (first line of the file). | - |
50
51### Examples
52
53When used with the [@semantic-release/git](https://github.com/semantic-release/git) or [@semantic-release/npm](https://github.com/semantic-release/npm) plugins the `@semantic-release/changelog` plugin must be called first in order to update the changelog file so the [@semantic-release/git](https://github.com/semantic-release/git) and [@semantic-release/npm](https://github.com/semantic-release/npm) plugins can include it in the release.
54
55```json
56{
57 "plugins": [
58 "@semantic-release/commit-analyzer",
59 "@semantic-release/release-notes-generator",
60 "@semantic-release/changelog",
61 "@semantic-release/npm",
62 "@semantic-release/git"
63 ],
64}
65```