semantic-release 15.13.17 → 15.13.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +39 -34
  2. package/docs/{usage → 01-usage}/README.md +0 -0
  3. package/docs/{usage → 01-usage}/ci-configuration.md +30 -10
  4. package/docs/{usage → 01-usage}/configuration.md +131 -56
  5. package/docs/01-usage/getting-started.md +32 -0
  6. package/docs/01-usage/installation.md +22 -0
  7. package/docs/{usage → 01-usage}/plugins.md +19 -22
  8. package/docs/01-usage/shareable-configurations.md +7 -0
  9. package/docs/{extending → 02-extending}/README.md +0 -0
  10. package/docs/{extending → 02-extending}/plugins-list.md +0 -0
  11. package/docs/02-extending/shareable-configurations-list.md +13 -0
  12. package/docs/03-recipes/README.md +3 -0
  13. package/docs/03-recipes/ci-pipelines-recipes.md +4 -0
  14. package/docs/{recipes → 03-recipes}/circleci-workflows.md +4 -4
  15. package/docs/{recipes → 03-recipes}/git-auth-ssh-keys.md +1 -1
  16. package/docs/03-recipes/git-hosted-services.md +2 -0
  17. package/docs/{recipes → 03-recipes}/gitlab-ci.md +4 -4
  18. package/docs/03-recipes/package-managers-and-languages.md +2 -0
  19. package/docs/{recipes → 03-recipes}/travis.md +6 -6
  20. package/docs/{developer-guide → 04-developer-guide}/README.md +0 -0
  21. package/docs/{developer-guide → 04-developer-guide}/js-api.md +3 -3
  22. package/docs/04-developer-guide/plugin.md +106 -0
  23. package/docs/{developer-guide → 04-developer-guide}/shareable-configuration.md +0 -0
  24. package/docs/{support → 05-support}/FAQ.md +19 -19
  25. package/docs/{support → 05-support}/README.md +0 -0
  26. package/docs/{support → 05-support}/node-support-policy.md +0 -0
  27. package/docs/{support → 05-support}/node-version.md +1 -1
  28. package/docs/{support → 05-support}/resources.md +0 -0
  29. package/docs/{support → 05-support}/troubleshooting.md +0 -0
  30. package/docs/README.md +5 -5
  31. package/lib/git.js +3 -3
  32. package/package.json +6 -14
  33. package/docs/developer-guide/plugin.md +0 -1
  34. package/docs/extending/shareable-configurations-list.md +0 -7
  35. package/docs/recipes/README.md +0 -11
  36. package/docs/usage/getting-started.md +0 -22
  37. package/docs/usage/installation.md +0 -29
  38. package/docs/usage/shareable-configurations.md +0 -7
package/README.md CHANGED
@@ -39,10 +39,10 @@ This removes the immediate connection between human emotions and version numbers
39
39
  - New features and fixes are immediately available to users
40
40
  - Notify maintainers and users of new releases
41
41
  - Use formalized commit message convention to document changes in the codebase
42
- - Integrate with your [continuous integration workflow](docs/recipes/README.md#ci-configurations)
42
+ - Integrate with your [continuous integration workflow](docs/03-recipes/README.md#ci-configurations)
43
43
  - Avoid potential errors associated with manual releases
44
- - Support any [package managers and languages](docs/recipes/README.md#package-managers-and-languages) via [plugins](docs/usage/plugins.md)
45
- - Simple and reusable configuration via [shareable configurations](docs/usage/shareable-configurations.md)
44
+ - Support any [package managers and languages](docs/03-recipes/README.md#package-managers-and-languages) via [plugins](docs/01-usage/plugins.md)
45
+ - Simple and reusable configuration via [shareable configurations](docs/01-usage/shareable-configurations.md)
46
46
 
47
47
  ## How does it work?
48
48
 
@@ -50,7 +50,7 @@ This removes the immediate connection between human emotions and version numbers
50
50
 
51
51
  **semantic-release** uses the commit messages to determine the type of changes in the codebase. Following formalized conventions for commit messages, **semantic-release** automatically determines the next [semantic version](https://semver.org) number, generates a changelog and publishes the release.
52
52
 
53
- By default **semantic-release** uses [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines). The commit message format can be changed with the [`preset` or `config` options](docs/usage/configuration.md#options) of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins.
53
+ By default **semantic-release** uses [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines). The commit message format can be changed with the [`preset` or `config` options](docs/01-usage/configuration.md#options) of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins.
54
54
 
55
55
  Tools such as [commitizen](https://github.com/commitizen/cz-cli), [commitlint](https://github.com/conventional-changelog/commitlint) or [semantic-git-commit-cli](https://github.com/JPeer264/node-semantic-git-commit-cli) can be used to help contributors and enforce valid commit messages.
56
56
 
@@ -71,50 +71,55 @@ Here is an example of the release type that will be done based on a commit messa
71
71
  For each new commits added to the release branch (i.e. `master`) with `git push` or by merging a pull request or merging from another branch, a CI build is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.
72
72
 
73
73
  If you need more control over the timing of releases you have a couple of options:
74
- - Publish releases on a distribution channel (for example npm’s [dist-tags](https://docs.npmjs.com/cli/dist-tag)). This way you can keep control over what your users end up using by default, and you can decide when to make an automatically released version available to the stable channel, and promote it.
74
+ - Publish releases on a distribution channel (for example npm’s [dist-tags](https://docs.npmjs.com/cli/dist-tag)). This way you can keep control over what your users end up using by default, and you can decide when to make an automatically released version available to the stable channel, and promote it. **NOTE**: `16.0.0-beta` of semantic-release, includes new features to automate the release of different branches to different npm distribution tags. The corresponding documentation can be found [on the beta branch of this repo](https://github.com/semantic-release/semantic-release/blob/beta/docs/recipes/distribution-channels.md#publishing-on-distribution-channels).
75
75
  - Develop on a `dev` branch and merge it to the release branch (i.e. `master`) once you are ready to publish. **semantic-release** will run only on pushes to the release branch.
76
76
 
77
77
  ### Release steps
78
78
 
79
79
  After running the tests, the command `semantic-release` will execute the following steps:
80
80
 
81
- | Step | Description |
82
- |-------------------|---------------------------------------------------------------------------------------------------------------------------------|
83
- | Verify Conditions | Verify all the conditions to proceed with the release. |
84
- | Get last release | Obtain the commit corresponding to the last release by analyzing [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging). |
85
- | Analyze commits | Determine the type of release based on the commits added since the last release. |
86
- | Verify release | Verify the release conformity. |
87
- | Generate notes | Generate release notes for the commits added since the last release. |
88
- | Create Git tag | Create a Git tag corresponding to the new release version. |
89
- | Prepare | Prepare the release. |
90
- | Publish | Publish the release. |
91
- | Notify | Notify of new releases or errors. |
81
+ | Step | Step Hook | Description |
82
+ |-------------------|----------------------|---------------------------------------------------------------------------------------------------------------------------------|
83
+ | Verify Conditions | `verifyConditions` | Verify all the conditions to proceed with the release. |
84
+ | Get last release | N/A | Obtain the commit corresponding to the last release by analyzing [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging). |
85
+ | Analyze commits | N/A | Determine the type of release based on the commits added since the last release. |
86
+ | Verify release | `verifyRelease` | Verify the release conformity. |
87
+ | Generate notes | `generateNotes` | Generate release notes for the commits added since the last release. |
88
+ | Create Git tag | N/A | Create a Git tag corresponding to the new release version. |
89
+ | Prepare | `prepare` | Prepare the release. |
90
+ | Publish | `publish` | Publish the release. |
91
+ | Notify | `success`, `failure` | Notify of new releases or errors. |
92
92
 
93
93
  ## Documentation
94
94
 
95
95
  - Usage
96
- - [Getting started](docs/usage/getting-started.md#getting-started)
97
- - [Installation](docs/usage/installation.md#installation)
98
- - [CI Configuration](docs/usage/ci-configuration.md#ci-configuration)
99
- - [Configuration](docs/usage/configuration.md#configuration)
100
- - [Plugins](docs/usage/plugins.md)
101
- - [Shareable configurations](docs/usage/shareable-configurations.md)
96
+ - [Getting started](docs/01-usage/getting-started.md)
97
+ - [Installation](docs/01-usage/installation.md#installation)
98
+ - [CI Configuration](docs/01-usage/ci-configuration.md#ci-configuration)
99
+ - [Configuration](docs/01-usage/configuration.md#configuration)
100
+ - [Plugins](docs/01-usage/plugins.md)
101
+ - [Shareable configurations](docs/01-usage/shareable-configurations.md)
102
102
  - Extending
103
- - [Plugins](docs/extending/plugins-list.md)
104
- - [Shareable configuration](docs/extending/shareable-configurations-list.md)
103
+ - [Available plugins](docs/02-extending/plugins-list.md)
104
+ - [Available shareable configuration](docs/02-extending/shareable-configurations-list.md)
105
105
  - Recipes
106
- - [CI configurations](docs/recipes/README.md)
107
- - [Package managers and languages](docs/recipes/README.md)
106
+ - [CI pipelines recipes](docs/03-recipes/ci-pipelines-recipes.md)
107
+ - [CircleCI 2.0 workflows](docs/03-recipes/circleci-workflows.md)
108
+ - [Travis CI](docs/03-recipes/travis.md)
109
+ - [GitLab CI](docs/03-recipes/gitlab-ci.md)
110
+ - [Git hosted services](docs/03-recipes/git-hosted-services.md)
111
+ - [Git authentication with SSH keys](docs/03-recipes/git-auth-ssh-keys.md)
112
+ - [Package managers and languages](docs/03-recipes/package-managers-and-languages.md)
108
113
  - Developer guide
109
- - [JavaScript API](docs/developer-guide/js-api.md)
110
- - [Plugins](docs/developer-guide/plugin.md)
111
- - [Shareable configuration](docs/developer-guide/shareable-configuration.md)
114
+ - [JavaScript API](docs/04-developer-guide/js-api.md)
115
+ - [Plugin development](docs/04-developer-guide/plugin.md)
116
+ - [Shareable configuration development](docs/04-developer-guide/shareable-configuration.md)
112
117
  - Support
113
- - [Resources](docs/support/resources.md)
114
- - [Frequently Asked Questions](docs/support/FAQ.md)
115
- - [Troubleshooting](docs/support/troubleshooting.md)
116
- - [Node version requirement](docs/support/node-version.md)
117
- - [Node Support Policy](docs/support/node-support-policy.md)
118
+ - [Resources](docs/05-support/resources.md)
119
+ - [Frequently Asked Questions](docs/05-support/FAQ.md)
120
+ - [Troubleshooting](docs/05-support/troubleshooting.md)
121
+ - [Node version requirement](docs/05-support/node-version.md)
122
+ - [Node Support Policy](docs/05-support/node-support-policy.md)
118
123
 
119
124
  ## Get help
120
125
 
File without changes
@@ -1,14 +1,29 @@
1
1
  # CI configuration
2
2
 
3
- ## Run `semantic-release` only after all tests succeeded
3
+ ## Running `semantic-release`
4
4
 
5
- The `semantic-release` command must be executed only after all the tests in the CI build pass. If the build runs multiple jobs (for example to test on multiple Operating Systems or Node versions) the CI has to be configured to guarantee that the `semantic-release` command is executed only after all jobs are successful. This can be achieved with [Travis Build Stages](https://docs.travis-ci.com/user/build-stages), [CircleCI Workflows](https://circleci.com/docs/2.0/workflows), [Codeship Deployment Pipelines](https://documentation.codeship.com/basic/builds-and-configuration/deployment-pipelines), [GitLab Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html#introduction-to-pipelines-and-jobs), [Codefresh Pipelines](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines), [Wercker Workflows](http://devcenter.wercker.com/docs/workflows) or [GoCD Pipelines](https://docs.gocd.org/current/introduction/concepts_in_go.html#pipeline).
5
+ The `semantic-release` command will only run fully in a CI environment. If it does not detect that it is in a CI environment, it will automatically run in `dry-run` mode.
6
+
7
+ Within a CI environment, the `semantic-release` command must be executed only after all the tests in the CI build pass, otherwise it will release potentially faulty code. If the build runs multiple jobs (for example to test on multiple Operating Systems or Node versions) the CI has to be configured to guarantee that the `semantic-release` command is executed only after all jobs are successful.
6
8
 
7
- See [CI configuration recipes](../recipes/README.md#ci-configurations) for more details.
9
+ Follow the CI system's documentation to find out how to do this:
10
+ - [Travis Build Stages](https://docs.travis-ci.com/user/build-stages)
11
+ - [CircleCI Workflows](https://circleci.com/docs/2.0/workflows)
12
+ - [Codeship Deployment Pipelines](https://documentation.codeship.com/basic/builds-and-configuration/deployment-pipelines)
13
+ - [GitLab Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html#introduction-to-pipelines-and-jobs)
14
+ - [Codefresh Pipelines](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines)
15
+ - [Wercker Workflows](http://devcenter.wercker.com/docs/workflows)
16
+ - [GoCD Pipelines](https://docs.gocd.org/current/introduction/concepts_in_go.html#pipeline).
17
+
18
+ This documentation provides a few [CI pipelines recipes](../03-recipes/ci-pipelines-recipes.md) for more details.
8
19
 
9
20
  ## Authentication
10
21
 
11
- **semantic-release** requires push access to the project Git repository in order to create [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging). The Git authentication can be set with one of the following environment variables:
22
+ ### Push access to remote repos
23
+
24
+ **semantic-release** requires push access to remote Git repositories in order to push the [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) it created.
25
+
26
+ The Git authentication can be set with one of the following environment variables:
12
27
 
13
28
  | Variable | Description |
14
29
  |---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -17,17 +32,22 @@ See [CI configuration recipes](../recipes/README.md#ci-configurations) for more
17
32
  | `BB_TOKEN` or `BITBUCKET_TOKEN` | A Bitbucket [personal access token](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html). |
18
33
  | `GIT_CREDENTIALS` | [URL encoded](https://en.wikipedia.org/wiki/Percent-encoding) Git username and password in the format `<username>:<password>`. The username and password must each be individually URL encoded, not the `:` separating them. |
19
34
 
20
- Alternatively the Git authentication can be set up via [SSH keys](../recipes/git-auth-ssh-keys.md).
35
+ Alternatively the Git authentication **can be set up via [SSH keys](../03-recipes/git-auth-ssh-keys.md)**.
21
36
 
22
- Most **semantic-release** [plugins](plugins.md) require setting up authentication in order to publish to a package manager registry. The default [@semantic-release/npm](https://github.com/semantic-release/npm#environment-variables) and [@semantic-release/github](https://github.com/semantic-release/github#environment-variables) plugins require the following environment variables:
37
+ ### Authentication needs for plugins
38
+
39
+ Most **semantic-release** [plugins](plugins.md) require setting up authentication in order to publish to a package manager registry. See each plugin's documentation for the environment variables required.
40
+
41
+ It is to note, however, that:
42
+ - The default [@semantic-release/github](https://github.com/semantic-release/github#environment-variables) plugin requires the same `GH_TOKEN` environment variable as above
43
+ - The default [@semantic-release/npm](https://github.com/semantic-release/npm#environment-variables) plugin requires the following environment variables:
23
44
 
24
45
  | Variable | Description |
25
46
  |-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
26
47
  | `NPM_TOKEN` | npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens).<br/>**Note**: Only the `auth-only` [level of npm two-factor authentication](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) is supported. |
27
- | `GH_TOKEN` | GitHub authentication token.<br/>**Note**: Only the [personal token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) authentication is supported. |
28
48
 
29
49
  See each plugin's documentation for the environment variables required.
30
50
 
31
- The authentication token/credentials have to be made available in the CI service via environment variables.
32
-
33
- See [CI configuration recipes](../recipes/README.md#ci-configurations) for more details on how to configure environment variables in your CI service.
51
+ > **Note**: The authentication token/credentials have to be made available in the CI service via environment variables.
52
+ >
53
+ > See [CI pipelines recipes](../03-recipes/ci-pipelines-recipes.md) for more details on how to configure environment variables in your CI service.
@@ -1,73 +1,93 @@
1
1
  # Configuration
2
2
 
3
3
  **semantic-release** configuration consists of:
4
- - Git repository options ([URL](#repositoryurl), [release branch](#branch) and [tag format](#tagformat))
5
- - [plugins](#plugins) definition
6
- - run mode ([debug](#debug), [dry run](#dryrun) and [local (no CI)](#ci))
4
+ - Git repository [url](#repositoryurl) and options ([release branch](#branch) and [tag format](#tagformat)). ([Access credentials](ci-configuration.md) are setup through environment variables)
5
+ - Plugins [declaration](#plugins) and [options](plugins.md).
6
+ - Run mode ([`--dry-run`](#dryrun), [`--no-ci`](#ci) (local), [`--debug`](#debug)).
7
7
 
8
- All of these options can be configured directly or by extending a [shareable configuration](shareable-configurations.md).
8
+ All of these options can be configured:
9
+ - In a config file.
10
+ - Through the cli.
11
+ - By extending a [shareable configuration](shareable-configurations.md).
9
12
 
10
13
  Additionally, metadata of Git tags generated by **semantic-release** can be customized via standard [Git environment variables](#git-environment-variables).
11
14
 
12
- ## Configuration file
15
+ ## Configuring/passing options to `semantic-release`
13
16
 
14
- **semantic-release**’s [options](#options), mode and [plugins](plugins.md) can be set via:
15
- - A `.releaserc` file, written in YAML or JSON, with optional extensions: .`yaml`/`.yml`/`.json`/`.js`
16
- - A `release.config.js` file that exports an object
17
- - A `release` key in the project's `package.json` file
17
+ ### Configuration file
18
18
 
19
- Alternatively, some options can be set via CLI arguments.
19
+ > **Note**: CLI arguments take precedence over options configured in the configuration file and shareable configuration.
20
20
 
21
- The following three examples are the same.
21
+ **semantic-release**’s options, mode and plugins can be set via a config file in different ways:
22
+ - A `.releaserc` file, written in YAML or JSON, with optional extensions `.yaml`, `.yml`, `.json` or `.js`.
23
+ - A `release.config.js` file that exports an object.
24
+ - A `release` key in the project's `package.json` file.
22
25
 
23
- Via `release` key in the project's `package.json` file:
26
+ The following two examples are the same:
27
+ - Via `.releaserc` or `release.config.js` file:
28
+ ```json
29
+ {
30
+ "branch": "next"
31
+ }
32
+ ```
33
+ - Via `release` key in the project's `package.json` file (the configuration must be under the `release` property):
34
+ ```json
35
+ {
36
+ "release": {
37
+ "branch": "next"
38
+ }
39
+ }
40
+ ```
24
41
 
25
- ```json
26
- {
27
- "release": {
28
- "branch": "next"
29
- }
30
- }
31
- ```
32
- ```bash
33
- $ semantic-release
34
- ```
42
+ ### Using CLI arguments
35
43
 
36
- Via `.releaserc` file:
44
+ > **Note**: CLI arguments take precedence over options configured in the configuration file and shareable configuration.
37
45
 
38
- ```json
39
- {
40
- "branch": "next"
41
- }
42
- ```
43
- ```bash
44
- $ semantic-release
45
- ```
46
+ Plugin options cannot be defined via CLI arguments and must be defined in the configuration file.
46
47
 
47
- Via CLI argument:
48
+ The following configuration example via CLI argument is equivalent to the configuration file's example:
48
49
 
49
50
  ```bash
50
51
  $ semantic-release --branch next
51
52
  ```
52
53
 
53
- **Note**: CLI arguments take precedence over options configured in the configuration file.
54
+ ### Extending a shareable configuration
54
55
 
55
- **Note**: Plugin options cannot be defined via CLI arguments and must be defined in the configuration file.
56
+ > **Note**: CLI arguments take precedence over options configured in the configuration file and shareable configuration.
56
57
 
57
- **Note**: When configuring via `package.json`, the configuration must be under the `release` property. However, when using a `.releaserc` or a `release.config.js` file, the configuration must be set without a `release` property.
58
+ Please see [shareable configuration](shareable-configurations.md) for more details.
58
59
 
59
60
  ## Options
60
61
 
61
- ### extends
62
+ ### `extends`
62
63
 
63
64
  Type: `Array`, `String`<br>
64
65
  CLI arguments: `-e`, `--extends`
65
66
 
66
- List of modules or file paths containing a [shareable configuration](shareable-configurations.md). If multiple shareable configurations are set, they will be imported in the order defined with each configuration option taking precedence over the options defined in a previous shareable configuration.
67
-
68
- **Note**: Options defined via CLI arguments or in the configuration file will take precedence over the ones defined in any shareable configuration.
69
-
70
- ### branch
67
+ Contains a list of:
68
+ - Modules.
69
+ - File paths containing a [shareable configuration](shareable-configurations.md).
70
+
71
+ > **Note**: If multiple shareable configurations are set, they will be imported **in the order defined with each configuration option** taking precedence over the options defined in a previous shareable configuration.
72
+
73
+ Examples (`.releaserc` file content):
74
+ - `Array`:
75
+ ```json
76
+ {
77
+ "extends": [
78
+ "./my_config_dir/my.config",
79
+ "@semantic-release/gitlab-config",
80
+ ]
81
+ }
82
+ ```
83
+ - `String`:
84
+ ```json
85
+ {
86
+ "extends": "@semantic-release/gitlab-config"
87
+ }
88
+ ```
89
+
90
+ ### `branch`
71
91
 
72
92
  Type: `String`<br>
73
93
  Default: `master`<br>
@@ -75,7 +95,14 @@ CLI arguments: `-b`, `--branch`
75
95
 
76
96
  The branch on which releases should happen.
77
97
 
78
- ### repositoryUrl
98
+ Example (`.releaserc` file content):
99
+ ```json
100
+ {
101
+ "branch": "next"
102
+ }
103
+ ```
104
+
105
+ ### `repositoryUrl`
79
106
 
80
107
  Type: `String`<br>
81
108
  Default: `repository` property in `package.json` or [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)<br>
@@ -85,7 +112,14 @@ The git repository URL.
85
112
 
86
113
  Any valid git url format is supported (See [Git protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols)).
87
114
 
88
- ### tagFormat
115
+ Example (`.releaserc` file content):
116
+ ```json
117
+ {
118
+ "repositoryUrl": "https://github.com/username/project.git"
119
+ }
120
+ ```
121
+
122
+ ### `tagFormat`
89
123
 
90
124
  Type: `String`<br>
91
125
  Default: `v${version}`<br>
@@ -93,21 +127,41 @@ CLI arguments: `-t`, `--tag-format`
93
127
 
94
128
  The [Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) format used by **semantic-release** to identify releases. The tag name is generated with [Lodash template](https://lodash.com/docs#template) and will be compiled with the `version` variable.
95
129
 
96
- **Note**: The `tagFormat` must contain the `version` variable exactly once and compile to a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description).
130
+ > **Note**: The `tagFormat` must contain the `version` variable exactly once and compile to a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description).
97
131
 
98
- ### plugins
132
+ Example (`.releaserc` file content):
133
+ ```json
134
+ {
135
+ "tagFormat": "version-${version}"
136
+ }
137
+ ```
138
+
139
+ ### `plugins`
99
140
 
100
141
  Type: `Array`<br>
101
142
  Default: `['@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/npm', '@semantic-release/github']`<br>
102
143
  CLI arguments: `-p`, `--plugins`
103
144
 
104
- Define the list of plugins to use. Plugins will run in series, in the order defined, for each [steps](../../README.md#release-steps) if they implement it.
105
-
106
- Plugins configuration can defined by wrapping the name and an options object in an array.
145
+ Define the list of plugins to use. Plugins will run in series, **in the order defined**, for **each [steps](../../README.md#release-steps)** if they implement it.
107
146
 
108
- See [Plugins configuration](plugins.md#plugins) for more details.
147
+ Plugin specific configuration can defined by wrapping the name and an options object in an array. See [Plugins configuration options](plugins.md#plugins-configuration-options) for more details.
109
148
 
110
- ### dryRun
149
+ Example (`.releaserc` file content):
150
+ ```json
151
+ {
152
+ "plugins": [
153
+ "@semantic-release/commit-analyzer",
154
+ "@semantic-release/release-notes-generator",
155
+ "@semantic-release-docker",
156
+ ["@semantic-release/exec", {
157
+ "verifyConditionsCmd": "./verify.sh"
158
+ }],
159
+ "@semantic-release/git",
160
+ "@semantic-release/gitlab",
161
+ ]
162
+ }
163
+ ```
164
+ ### `dryRun`
111
165
 
112
166
  Type: `Boolean`<br>
113
167
  Default: `false` if running in a CI environment, `true` otherwise<br>
@@ -115,7 +169,14 @@ CLI arguments: `-d`, `--dry-run`
115
169
 
116
170
  Dry-run mode, skip publishing, print next version and release notes.
117
171
 
118
- ### ci
172
+ Example (`.releaserc` file content):
173
+ ```json
174
+ {
175
+ "dryRun": "true"
176
+ }
177
+ ```
178
+
179
+ ### `ci`
119
180
 
120
181
  Type: `Boolean`<br>
121
182
  Default: `true`<br>
@@ -123,9 +184,16 @@ CLI arguments: `--ci` / `--no-ci`
123
184
 
124
185
  Set to `false` to skip Continuous Integration environment verifications. This allows for making releases from a local machine.
125
186
 
126
- **Note**: The CLI arguments `--no-ci` is equivalent to `--ci false`.
187
+ > **Note**: The CLI arguments `--no-ci` is equivalent to `--ci false`.
188
+
189
+ Example (`.releaserc` file content):
190
+ ```json
191
+ {
192
+ "ci": "false"
193
+ }
194
+ ```
127
195
 
128
- ### debug
196
+ ### `debug` (only through CLI)
129
197
 
130
198
  Type: `Boolean`<br>
131
199
  Default: `false`<br>
@@ -133,7 +201,12 @@ CLI argument: `--debug`
133
201
 
134
202
  Output debugging information. This can also be enabled by setting the `DEBUG` environment variable to `semantic-release:*`.
135
203
 
136
- **Note**: The `debug` is used only supported via CLI argument. To enable debug mode from the [JS API](../developer-guide/js-api.md#javascript-api) use `require('debug').enable('semantic-release:*')`.
204
+ > **Note**: The `debug` is used only supported via CLI argument. To enable debug mode from the [JS API](../04-developer-guide/js-api.md#javascript-api) use `require('debug').enable('semantic-release:*')`.
205
+
206
+ Example:
207
+ ```bash
208
+ $ semantic-release --debug
209
+ ```
137
210
 
138
211
  ## Git environment variables
139
212
 
@@ -144,9 +217,11 @@ Output debugging information. This can also be enabled by setting the `DEBUG` en
144
217
  | `GIT_COMMITTER_NAME` | The committer name associated with the [Git release tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot. |
145
218
  | `GIT_COMMITTER_EMAIL` | The committer email associated with the [Git release tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging). See [Git environment variables](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing). | @semantic-release-bot email address. |
146
219
 
147
- ## Existing version tags
220
+ ## Existing version tags, and how semantic-release deals with them
221
+
222
+ **semantic-release** uses [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) to determine the commits added since the last release.
148
223
 
149
- **semantic-release** uses [Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) to determine the commits added since the last release. If a release has been published before setting up **semantic-release** you must make sure the most recent commit included in the last published release is in the [release branch](#branch) history and is tagged with the version released, formatted according to the [tag format](#tagformat) configured (defaults to `vx.y.z`).
224
+ If a release has been published before setting up **semantic-release** you must make sure the most recent commit included in the last published release is in the [release branch](#branch) history and is tagged with the version released, formatted according to the [tag format](#tagformat) configured (defaults to `vx.y.z`).
150
225
 
151
226
  If the previous releases were published with [`npm publish`](https://docs.npmjs.com/cli/publish) this should already be the case.
152
227
 
@@ -0,0 +1,32 @@
1
+ # Getting started
2
+
3
+ ## Manual setup
4
+
5
+ You can use **semantic-release** with the following manual setup steps:
6
+
7
+ 1. [Install **semantic-release**](installation.md) either locally for your project or globally
8
+ 1. Configure:
9
+ 1. Your Continuous Integration service to [run **semantic-release**](ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded)
10
+ 1. Your Git repository and package manager repository [authentication](ci-configuration.md#authentication) in your Continuous Integration service
11
+ 1. **semantic-release**'s [options and plugins](configuration.md)
12
+
13
+ ## Guided setup through `semantic-release-cli`
14
+ Alternatively you can be guided through those setup steps thanks to the [interactive CLI `semantic-release-cli`](https://github.com/semantic-release/cli).
15
+
16
+ First install `semantic-release-cli`:
17
+ ```bash
18
+ $ npm install -g semantic-release-cli
19
+ ```
20
+
21
+ Then go to your project's directory and run the command:
22
+ ```bash
23
+ $ cd your-module
24
+ $ semantic-release-cli setup
25
+ ```
26
+ The output looks something like this:
27
+
28
+ ![dialogue](../../media/semantic-release-cli.png)
29
+
30
+ Available options and other information can be found on [`semantic-release-cli`'s doc](https://github.com/semantic-release/cli#semantic-release-cli).
31
+
32
+ > **Note**: only a limited number of options, CI services and plugins are currently supported by `semantic-release-cli`.
@@ -0,0 +1,22 @@
1
+ # Installation
2
+
3
+ ## Local installation
4
+
5
+ For [Node modules projects](https://docs.npmjs.com/getting-started/creating-node-modules) we recommend installing **semantic-release** locally and running the `semantic-release` command with [npx](https://www.npmjs.com/package/npx):
6
+
7
+ ```bash
8
+ $ npm install --save-dev semantic-release
9
+ ```
10
+
11
+ Then in the CI environment:
12
+
13
+ ```bash
14
+ $ npx semantic-release
15
+ ```
16
+
17
+ > **Note:** `npx` is a tool bundled with `npm@>=5.2.0`. It is used to conveniently find the semantic-release binary and to execute it. See [What is npx](../05-support/FAQ.md#what-is-npx) for more details.
18
+
19
+ ## Global installation
20
+
21
+ > **Note:** Global installation is no longer recommended. Please use local installation and `npx` instead.
22
+
@@ -1,13 +1,15 @@
1
1
  # Plugins
2
2
 
3
- Each [release step](../../README.md#release-steps) is implemented by configurable plugins. This allows for support of different [commit message formats](../../README.md#commit-message-format), release note generators and publishing platforms.
3
+ ## Plugins implement actions for release steps
4
4
 
5
- A plugin is a npm module that can implement one or more of the following steps:
5
+ Actions that should be performed for each [release step](../../README.md#release-steps) are implemented through configurable plugins, and [a number of them are installed by default](#plugins-installed-by-default). This allows for support of different [commit message formats](../../README.md#commit-message-format), release note generators and publishing platforms.
6
6
 
7
- | Step | Required | Description |
7
+ A plugin is a npm module (for instance `@semantic-release/github` or `semantic-release-docker`) that can implement one or more of the following steps through their step hooks:
8
+
9
+ | Step hook | Required | Description |
8
10
  |--------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
9
11
  | `verifyConditions` | No | Responsible for verifying conditions necessary to proceed with the release: configuration is correct, authentication token are valid, etc... |
10
- | `analyzeCommits` | Yes | Responsible for determining the type of the next release (`major`, `minor` or `patch`). If multiple plugins with a `analyzeCommits` step are defined, the release type will be the highest one among plugins output. |
12
+ | `analyzeCommits` | Yes | Responsible for determining the type of the next release (`major`, `minor` or `patch`). If multiple plugins with a `analyzeCommits` step are defined, the release type will be the highest one among plugins output. <br> **Note**: If no plugin with an `analyzeCommits` step is defined, then `@semantic-release/commit-analyzer` will be used.|
11
13
  | `verifyRelease` | No | Responsible for verifying the parameters (version, type, dist-tag etc...) of the release that is about to be published. |
12
14
  | `generateNotes` | No | Responsible for generating the content of the release note. If multiple plugins with a `generateNotes` step are defined, the release notes will be the result of the concatenation of each plugin output. |
13
15
  | `prepare` | No | Responsible for preparing the release, for example creating or updating files such as `package.json`, `CHANGELOG.md`, documentation or compiled assets and pushing a commit. |
@@ -15,10 +17,10 @@ A plugin is a npm module that can implement one or more of the following steps:
15
17
  | `success` | No | Responsible for notifying of a new release. |
16
18
  | `fail` | No | Responsible for notifying of a failed release. |
17
19
 
18
- **Note:** If no plugin with a `analyzeCommits` step is defined `@semantic-release/commit-analyzer` will be used.
19
-
20
20
  ## Plugins installation
21
21
 
22
+ ### Plugins installed by default
23
+
22
24
  These five plugins are already part of **semantic-release** and don't have to be installed separately:
23
25
  ```
24
26
  "@semantic-release/commit-analyzer"
@@ -28,26 +30,19 @@ These five plugins are already part of **semantic-release** and don't have to be
28
30
  "@semantic-release/release-notes-generator"
29
31
  ```
30
32
 
31
- [Additional plugins](../extending/plugins-list.md) have to be installed via npm:
33
+ ### Installing additional plugins
34
+
35
+ [Additional plugins](../02-extending/plugins-list.md) have to be installed via npm:
32
36
 
33
37
  ```bash
34
38
  $ npm install @semantic-release/git @semantic-release/changelog -D
35
39
  ```
36
40
 
37
- ## Plugins configuration
38
-
39
- Each plugin must be configured with the [`plugins` options](./configuration.md#plugins) by specifying the list of plugins by npm module name.
40
-
41
- ```json
42
- {
43
- "plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/npm"]
44
- }
45
- ```
46
-
47
- ## Plugin ordering
41
+ ## Plugins declaration and execution order
48
42
 
49
- For each [release step](../../README.md#release-steps) the plugins that implement that step will be executed in the order in which the are defined.
43
+ Each plugin (which is an npm module) must be declared using the [`plugins` option](./configuration.md#plugins). If the `plugins` option is defined, then the default is overriden (rather than merge with the option's default).
50
44
 
45
+ For example:
51
46
  ```json
52
47
  {
53
48
  "plugins": [
@@ -59,16 +54,18 @@ For each [release step](../../README.md#release-steps) the plugins that implemen
59
54
  }
60
55
  ```
61
56
 
62
- With this configuration **semantic-release** will:
57
+ For each [release step](../../README.md#release-steps) the plugins that implement that step will be executed **in the order in which they are declared**.
58
+
59
+ Hence, with this configuration above, **semantic-release** will:
63
60
  - execute the `verifyConditions` implementation of `@semantic-release/npm` then `@semantic-release/git`
64
61
  - execute the `analyzeCommits` implementation of `@semantic-release/commit-analyzer`
65
62
  - execute the `prepare` implementation of `@semantic-release/npm` then `@semantic-release/git`
66
63
  - execute the `generateNotes` implementation of `@semantic-release/release-notes-generator`
67
64
  - execute the `publish` implementation of `@semantic-release/npm`
68
65
 
69
- ## Plugin options
66
+ ## Plugins configuration options
70
67
 
71
- A plugin options can specified by wrapping the name and an options object in an array. Options configured this way will be passed only to that specific plugin.
68
+ A plugin configuration options can specified by wrapping the name and an options object in an array. Options configured this way will be passed only to that specific plugin.
72
69
 
73
70
  Global plugin options can defined at the root of the **semantic-release** configuration object. Options configured this way will be passed to all plugins.
74
71
 
@@ -0,0 +1,7 @@
1
+ # Shareable configurations
2
+
3
+ A shareable configuration is an npm package that exports a **semantic-release** configuration object. It allows for use of the same configuration across several projects.
4
+
5
+ Shareable configurations to be use can be declared with the [`extends` option](configuration.md#extends).
6
+
7
+ See [shareable configurations list](../02-extending/shareable-configurations-list.md) for examples.
File without changes
File without changes