semantic-release 17.4.1 → 17.4.5
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.
- package/README.md +1 -1
- package/docs/developer-guide/plugin.md +166 -6
- package/docs/extending/plugins-list.md +14 -1
- package/docs/recipes/circleci-workflows.md +16 -23
- package/docs/recipes/distribution-channels.md +1 -1
- package/docs/recipes/github-actions.md +1 -1
- package/docs/recipes/maintenance-releases.md +2 -2
- package/docs/support/resources.md +1 -0
- package/docs/support/troubleshooting.md +1 -1
- package/docs/usage/plugins.md +4 -0
- package/docs/usage/workflow-configuration.md +3 -3
- package/lib/definitions/errors.js +2 -2
- package/lib/git.js +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ By default **semantic-release** uses [Angular Commit Message Conventions](https:
|
|
|
52
52
|
|
|
53
53
|
Tools such as [commitizen](https://github.com/commitizen/cz-cli) or [commitlint](https://github.com/conventional-changelog/commitlint) can be used to help contributors and enforce valid commit messages.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
The table below shows which commit message gets you which release type when `semantic-release` runs (using the default configuration):
|
|
56
56
|
|
|
57
57
|
| Commit message | Release type |
|
|
58
58
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# Plugin Developer Guide
|
|
2
2
|
|
|
3
|
-
To create a plugin for `semantic-release`, you need to decide which parts of the release lifecycle are important to that plugin. For example, it is best to always have a `
|
|
3
|
+
To create a plugin for `semantic-release`, you need to decide which parts of the release lifecycle are important to that plugin. For example, it is best to always have a `verifyConditions` step because you may be receiving inputs from a user and want to make sure they exist. A plugin can abide by any of the following lifecycles:
|
|
4
4
|
|
|
5
|
-
- `
|
|
5
|
+
- `verifyConditions`
|
|
6
|
+
- `analyzeCommits`
|
|
7
|
+
- `verifyRelease`
|
|
8
|
+
- `generateNotes`
|
|
9
|
+
- `addChannel`
|
|
6
10
|
- `prepare`
|
|
7
11
|
- `publish`
|
|
8
12
|
- `success`
|
|
9
13
|
- `fail`
|
|
10
14
|
|
|
11
|
-
`semantic-release` will require the plugin via `node` and look through the required object for methods named like the lifecyles stated above. For example, if your plugin only had a `
|
|
15
|
+
`semantic-release` will require the plugin via `node` and look through the required object for methods named like the lifecyles stated above. For example, if your plugin only had a `verifyConditions` and `success` step, the `main` file for your object would need to `export` an object with `verifyConditions` and `success` functions.
|
|
12
16
|
|
|
13
17
|
In addition to the lifecycle methods, each lifecyle is passed two objects:
|
|
14
18
|
|
|
@@ -93,7 +97,136 @@ if (message.length) {
|
|
|
93
97
|
}
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-
##
|
|
100
|
+
## Context
|
|
101
|
+
|
|
102
|
+
### Common context keys
|
|
103
|
+
|
|
104
|
+
* `stdout`
|
|
105
|
+
* `stderr`
|
|
106
|
+
* `logger`
|
|
107
|
+
|
|
108
|
+
### Context object keys by lifecycle
|
|
109
|
+
|
|
110
|
+
#### verifyConditions
|
|
111
|
+
|
|
112
|
+
Initially the context object contains the following keys (`verifyConditions` lifecycle):
|
|
113
|
+
* `cwd`
|
|
114
|
+
* Current working directory
|
|
115
|
+
* `env`
|
|
116
|
+
* Environment variables
|
|
117
|
+
* `envCi`
|
|
118
|
+
* Information about CI environment
|
|
119
|
+
* Contains (at least) the following keys:
|
|
120
|
+
* `isCi`
|
|
121
|
+
* Boolean, true if the environment is a CI environment
|
|
122
|
+
* `commit`
|
|
123
|
+
* Commit hash
|
|
124
|
+
* `branch`
|
|
125
|
+
* Current branch
|
|
126
|
+
* `options`
|
|
127
|
+
* Options passed to `semantic-release` via CLI, configuration files etc.
|
|
128
|
+
* `branch`
|
|
129
|
+
* Information on the current branch
|
|
130
|
+
* Object keys:
|
|
131
|
+
* `channel`
|
|
132
|
+
* `tags`
|
|
133
|
+
* `type`
|
|
134
|
+
* `name`
|
|
135
|
+
* `range`
|
|
136
|
+
* `accept`
|
|
137
|
+
* `main`
|
|
138
|
+
* `branches`
|
|
139
|
+
* Information on branches
|
|
140
|
+
* List of branch objects (see above)
|
|
141
|
+
|
|
142
|
+
#### analyzeCommits
|
|
143
|
+
|
|
144
|
+
Compared to the verifyConditions, `analyzeCommits` lifecycle context has keys
|
|
145
|
+
|
|
146
|
+
* `commits` (List)
|
|
147
|
+
* List of commits taken into account when determining the new version.
|
|
148
|
+
* Keys:
|
|
149
|
+
* `commit` (Object)
|
|
150
|
+
* Keys:
|
|
151
|
+
* `long` (String, Commit hash)
|
|
152
|
+
* `short` (String, Commit hash)
|
|
153
|
+
* `tree` (Object)
|
|
154
|
+
* Keys:
|
|
155
|
+
* `long` (String, Commit hash)
|
|
156
|
+
* `short` (String, Commit hash)
|
|
157
|
+
* `author` (Object)
|
|
158
|
+
* Keys:
|
|
159
|
+
* `name` (String)
|
|
160
|
+
* `email` (String)
|
|
161
|
+
* `date` (String, ISO 8601 timestamp)
|
|
162
|
+
* `committer` (Object)
|
|
163
|
+
* Keys:
|
|
164
|
+
* `name` (String)
|
|
165
|
+
* `email` (String)
|
|
166
|
+
* `date` (String, ISO 8601 timestamp)
|
|
167
|
+
* `subject` (String, Commit message subject)
|
|
168
|
+
* `body` (String, Commit message body)
|
|
169
|
+
* `hash` (String, Commit hash)
|
|
170
|
+
* `committerDate` (String, ISO 8601 timestamp)
|
|
171
|
+
* `message` (String)
|
|
172
|
+
* `gitTags` (String, List of git tags)
|
|
173
|
+
* `releases` (List)
|
|
174
|
+
* `lastRelease` (Object)
|
|
175
|
+
* Keys
|
|
176
|
+
* `version` (String)
|
|
177
|
+
* `gitTag` (String)
|
|
178
|
+
* `channels` (List)
|
|
179
|
+
* `gitHead` (String, Commit hash)
|
|
180
|
+
* `name` (String)
|
|
181
|
+
|
|
182
|
+
#### verifyRelease
|
|
183
|
+
|
|
184
|
+
Additional keys:
|
|
185
|
+
|
|
186
|
+
* `nextRelease` (Object)
|
|
187
|
+
* `type` (String)
|
|
188
|
+
* `channel` (String)
|
|
189
|
+
* `gitHead` (String, Git hash)
|
|
190
|
+
* `version` (String, version without `v`)
|
|
191
|
+
* `gitTag` (String, version with `v`)
|
|
192
|
+
* `name` (String)
|
|
193
|
+
|
|
194
|
+
#### generateNotes
|
|
195
|
+
|
|
196
|
+
No new content in the context.
|
|
197
|
+
|
|
198
|
+
#### addChannel
|
|
199
|
+
|
|
200
|
+
*This is run only if there are releases that have been merged from a higher branch but not added on the channel of the current branch.*
|
|
201
|
+
|
|
202
|
+
Context content is similar to lifecycle `verifyRelease`.
|
|
203
|
+
|
|
204
|
+
#### prepare
|
|
205
|
+
|
|
206
|
+
Only change is that `generateNotes` has populated `nextRelease.notes`.
|
|
207
|
+
|
|
208
|
+
#### publish
|
|
209
|
+
|
|
210
|
+
No new content in the context.
|
|
211
|
+
|
|
212
|
+
#### success
|
|
213
|
+
|
|
214
|
+
Lifecycles `success` and `fail` are mutually exclusive, only one of them will be run.
|
|
215
|
+
|
|
216
|
+
Additional keys:
|
|
217
|
+
|
|
218
|
+
* `releases`
|
|
219
|
+
* Populated by `publish` lifecycle
|
|
220
|
+
|
|
221
|
+
#### fail
|
|
222
|
+
|
|
223
|
+
Lifecycles `success` and `fail` are mutually exclusive, only one of them will be run.
|
|
224
|
+
|
|
225
|
+
Additional keys:
|
|
226
|
+
|
|
227
|
+
* `errors`
|
|
228
|
+
|
|
229
|
+
### Supporting Environment Variables
|
|
97
230
|
|
|
98
231
|
Similar to `options`, environment variables exist to allow users to pass tokens and set special URLs. These are set on the `context` object instead of the `pluginConfig` object. Let's say we wanted to check for `GITHUB_TOKEN` in the environment because we want to post to GitHub on the user's behalf. To do this, we can add the following to our `verify` command:
|
|
99
232
|
|
|
@@ -101,6 +234,33 @@ Similar to `options`, environment variables exist to allow users to pass tokens
|
|
|
101
234
|
const { env } = context;
|
|
102
235
|
|
|
103
236
|
if (env.GITHUB_TOKEN) {
|
|
104
|
-
|
|
237
|
+
//...
|
|
105
238
|
}
|
|
106
|
-
```
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Execution order
|
|
242
|
+
|
|
243
|
+
For the lifecycles, the list at the top of the readme contains the order. If there are multiple plugins for the same lifecycle, then the order of the plugins determines the order in which they are executed.
|
|
244
|
+
|
|
245
|
+
## Handling errors
|
|
246
|
+
|
|
247
|
+
In order to be able to detect and handle errors properly, the errors thrown from the must be of type [SemanticReleaseError](https://github.com/semantic-release/error) or extend it as described in the package readme. This way the errors are handled properly and plugins using the `fail` lifecycle receive the errors correctly. For any other types of errors the internal error handling does nothing, lets them through up until the final catch and does not call any `fail` plugins.
|
|
248
|
+
|
|
249
|
+
## Advanced
|
|
250
|
+
|
|
251
|
+
Knowledge that might be useful for plugin developers.
|
|
252
|
+
|
|
253
|
+
### Multiple analyzeCommits plugins
|
|
254
|
+
|
|
255
|
+
While it may be trivial that multiple analyzeCommits (or any lifecycle plugins) can be defined, it is not that self-evident that the plugins executed AFTER the first one (for example, the default one: `commit-analyzer`) can change the result. This way it is possible to create more advanced rules or situations, e.g. if none of the commits would result in new release, then a default can be defined.
|
|
256
|
+
|
|
257
|
+
The commit must be a known release type, for example the commit-analyzer has the following default types:
|
|
258
|
+
* major
|
|
259
|
+
* premajor
|
|
260
|
+
* minor
|
|
261
|
+
* preminor
|
|
262
|
+
* patch
|
|
263
|
+
* prepatch
|
|
264
|
+
* prerelease
|
|
265
|
+
|
|
266
|
+
If the analyzeCommits-lifecycle plugin does not return anything, then the earlier result is used, but if it returns a supported string value, then that overrides the previous result.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- `publish`: Publish the package on the npm registry
|
|
21
21
|
- [@semantic-release/gitlab](https://github.com/semantic-release/gitlab)
|
|
22
22
|
- `verifyConditions`: Verify the presence and the validity of the GitLab authentication and release configuration
|
|
23
|
-
- `publish`: Publish a [GitLab release](https://docs.gitlab.com/
|
|
23
|
+
- `publish`: Publish a [GitLab release](https://docs.gitlab.com/ee/user/project/releases/)
|
|
24
24
|
- [@semantic-release/git](https://github.com/semantic-release/git)
|
|
25
25
|
- `verifyConditions`: Verify the presence and the validity of the Git authentication and release configuration
|
|
26
26
|
- `prepare`: Push a release commit and tag, including configurable files
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
- [semantic-release-docker](https://github.com/felixfbecker/semantic-release-docker)
|
|
53
53
|
- `verifyConditions`: Verify that all needed configuration is present and login to the Docker registry.
|
|
54
54
|
- `publish`: Tag the image specified by `name` with the new version, push it to Docker Hub and update the latest tag
|
|
55
|
+
- [@semantic-release-plus/docker](https://github.com/semantic-release-plus/semantic-release-plus/tree/master/packages/plugins/docker)
|
|
56
|
+
- `verifyConditions`: Verify that all needed configuration is present and login to the configured docker registry.
|
|
57
|
+
- `publish`: Tag the image specified by `name` with the new version, push it to the configured docker registry and update the `latest`, `major`, `minor` tags based on the configuration settings.
|
|
55
58
|
- [semantic-release-gcr](https://github.com/carlos-cubas/semantic-release-gcr)
|
|
56
59
|
- `verifyConditions`: Verify that all needed configuration is present and login to the Docker registry
|
|
57
60
|
- `publish`: Tag the image specified by `name` with the new version, push it to Docker Hub and update the latest tag
|
|
@@ -127,3 +130,13 @@
|
|
|
127
130
|
- `verifyConditions`: Validate configuration and (if present) credentials
|
|
128
131
|
- `prepare`: Update version and appVersion in ```Chart.yaml```
|
|
129
132
|
- `publish`: Publish the chart to a registry (if configured)
|
|
133
|
+
- [semantic-release-codeartifact](https://github.com/ryansonshine/semantic-release-codeartifact)
|
|
134
|
+
- `verifyConditions`: Validate configuration, get AWS CodeArtifact authentication and repository, validate `publishConfig` or `.npmrc` (if they exist), then pass the configuration to the associated plugins.
|
|
135
|
+
- [semantic-release-telegram](https://github.com/pustovitDmytro/semantic-release-telegram)
|
|
136
|
+
- `verifyConditions`: Validate configuration and verify ```TELEGRAM_BOT_ID``` and ```TELEGRAM_BOT_TOKEN```
|
|
137
|
+
- `success`: Publish a message about the successful release to a telegram chat
|
|
138
|
+
- `fail`: publish a message about failure to a telegram chat
|
|
139
|
+
- [semantic-release-heroku](https://github.com/pustovitDmytro/semantic-release-heroku)
|
|
140
|
+
- `verifyConditions`: Validate configuration and verify ```HEROKU_API_KEY```
|
|
141
|
+
- `prepare`: Update the package.json version and create release tarball
|
|
142
|
+
- `publish`: Publish version to heroku
|
|
@@ -10,46 +10,39 @@ Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with
|
|
|
10
10
|
|
|
11
11
|
### `.circleci/config.yml` configuration for multiple Node jobs
|
|
12
12
|
|
|
13
|
-
This example is a minimal configuration for **semantic-release** with
|
|
13
|
+
This example is a minimal configuration for **semantic-release** with tests running against Node 16 and 14. See [CircleCI documentation](https://circleci.com/docs/2.0) for additional configuration options.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
In this example, the [`circleci/node`](https://circleci.com/developer/orbs/orb/circleci/node) orb is imported (Which makes some node operations easier), then a `release` job is defined which will run `semantic-release`.
|
|
16
|
+
|
|
17
|
+
To run our `release` job, we have created a workflow named `test_and_release` which will run two jobs, `node/test`, which comes from the node orb and will test our application, and our release job. Here, we are actually making use of [matrix jobs](https://circleci.com/blog/circleci-matrix-jobs/) so that our single `node/test` job will actually be executed twice, once for Node version 16, and once for version 14. Finally, we call our release job with a `requires` parameter so that `release` will only run after `node/test` has successfully tested against v14 and v16.
|
|
16
18
|
|
|
17
19
|
```yaml
|
|
18
|
-
version: 2
|
|
20
|
+
version: 2.1
|
|
21
|
+
orbs:
|
|
22
|
+
node: circleci/node@4.5
|
|
19
23
|
jobs:
|
|
20
|
-
test_node_6:
|
|
21
|
-
docker:
|
|
22
|
-
- image: circleci/node:6
|
|
23
|
-
steps:
|
|
24
|
-
# Configure your test steps here (checkout, npm install, cache management, tests etc...)
|
|
25
|
-
|
|
26
|
-
test_node_8:
|
|
27
|
-
docker:
|
|
28
|
-
- image: circleci/node:8
|
|
29
|
-
steps:
|
|
30
|
-
# Configure your test steps here (checkout, npm install, cache management, tests etc...)
|
|
31
|
-
|
|
32
24
|
release:
|
|
33
|
-
|
|
34
|
-
- image: circleci/node:8
|
|
25
|
+
executor: node/default
|
|
35
26
|
steps:
|
|
36
27
|
- checkout
|
|
37
|
-
-
|
|
28
|
+
- node/install-packages # Install and automatically cache packages
|
|
38
29
|
# Run optional required steps before releasing
|
|
39
30
|
# - run: npm run build-script
|
|
40
31
|
- run: npx semantic-release
|
|
41
32
|
|
|
42
33
|
workflows:
|
|
43
|
-
version: 2
|
|
44
34
|
test_and_release:
|
|
45
35
|
# Run the test jobs first, then the release only when all the test jobs are successful
|
|
46
36
|
jobs:
|
|
47
|
-
-
|
|
48
|
-
|
|
37
|
+
- node/test:
|
|
38
|
+
matrix:
|
|
39
|
+
parameters:
|
|
40
|
+
version:
|
|
41
|
+
- 16.1.0
|
|
42
|
+
- 14.7.0
|
|
49
43
|
- release:
|
|
50
44
|
requires:
|
|
51
|
-
-
|
|
52
|
-
- test_node_8
|
|
45
|
+
- node/test
|
|
53
46
|
```
|
|
54
47
|
|
|
55
48
|
### `package.json` configuration for multiple Node jobs
|
|
@@ -97,7 +97,7 @@ The Git history of the repository is now:
|
|
|
97
97
|
|
|
98
98
|
After a period of feedback from our users using the `@next` dist-tag we feel confident to make our big feature available to all users. To do so we merge the `next` branch into `master`. There should be no conflict as `next` is strictly ahead of `master`.
|
|
99
99
|
|
|
100
|
-
Once the merge commit is pushed to `
|
|
100
|
+
Once the merge commit is pushed to `master`, **semantic-release** will add the version `2.1.0` to the dist-tag `@latest` so all users will receive it when installing out module with `npm install example-module`.
|
|
101
101
|
|
|
102
102
|
The Git history of the repository is now:
|
|
103
103
|
|
|
@@ -33,7 +33,7 @@ The Git history of the repository is now:
|
|
|
33
33
|
|
|
34
34
|
One of our users request a new feature, however they cannot migrate to Node.js 8 or higher due to corporate policies.
|
|
35
35
|
|
|
36
|
-
If we were to push that feature on `master` and release it, the new version would require Node.js 8 or higher as the release would also
|
|
36
|
+
If we were to push that feature on `master` and release it, the new version would require Node.js 8 or higher as the release would also contain the commit `feat: drop Node.js 6 support \n\n BREAKING CHANGE: Node.js >= 8 required`.
|
|
37
37
|
|
|
38
38
|
Instead, we create the branch `1.x` from the tag `v1.0.0` with the command `git checkout -b 1.x v1.0.0` and we commit that feature with the message `feat: a feature` to the branch `1.x`. When pushing that commit, **semantic-release** will release the version `1.1.0` on the dist-tag `@release-1.x` so users who can't migrate to Node.js 8 or higher can benefit from it.
|
|
39
39
|
|
|
@@ -48,7 +48,7 @@ The Git history of the repository is now:
|
|
|
48
48
|
|
|
49
49
|
## Releasing a bug fix for version 1.0.x users
|
|
50
50
|
|
|
51
|
-
Another user currently using version `1.0.0` reports a bug. They cannot migrate to Node.js 8 or higher and they also cannot migrate to `1.1.0` as they do not use the feature developed in `feat: a feature` and their corporate policies require to go through a costly quality
|
|
51
|
+
Another user currently using version `1.0.0` reports a bug. They cannot migrate to Node.js 8 or higher and they also cannot migrate to `1.1.0` as they do not use the feature developed in `feat: a feature` and their corporate policies require to go through a costly quality assurance process for each `minor` upgrades.
|
|
52
52
|
|
|
53
53
|
In order to deliver the bug fix in a `patch` release, we create the branch `1.0.x` from the tag `v1.0.0` with the command `git checkout -b 1.0.x v1.0.0` and we commit that fix with the message `fix: a fix` to the branch `1.0.x`. When pushing that commit, **semantic-release** will release the version `1.0.1` on the dist-tag `@release-1.0.x` so users who can't migrate to `1.1.x` or `2.x` can benefit from it.
|
|
54
54
|
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
- ["Introduction to SemVer" - Irina Gebauer](https://blog.greenkeeper.io/introduction-to-semver-d272990c44f2)
|
|
16
16
|
- ["Introduction to Semantic Release" - liv](https://blog.greenkeeper.io/introduction-to-semantic-release-33f73b117c8)
|
|
17
17
|
- ["Series - Semantic Release Automation" - Abdelrahman Wahdan](https://dev.to/abdelrahmanahmed/semantic-release-and-how-to-automate-it-part-1-4pa2)
|
|
18
|
+
- ["Explain semantic release and how to use it on GitLab pipeline"](https://regoo707.medium.com/auto-bump-apps-versions-and-releases-using-gitlab-pipeline-e32f1d7fa3ee)
|
|
18
19
|
|
|
19
20
|
## Tutorials
|
|
20
21
|
|
|
@@ -65,5 +65,5 @@ To recover from that situation, do the following:
|
|
|
65
65
|
|
|
66
66
|
1. Delete the tag(s) for the release(s) that have been lost from the git history. You can delete each tag from remote using `git push origin :[TAG NAME]`, e.g. `git push origin :v2.0.0-beta.1`. You can delete tags locally using `git tag -d [TAG NAME]`, e.g. `git tag -d v2.0.0-beta.1`.
|
|
67
67
|
2. Re-create the tags locally: `git tag [TAG NAME] [COMMIT HASH]`, where `[COMMIT HASH]` is the new commit that created the release for the lost tag. E.g. `git tag v2.0.0-beta.1 abcdef0`
|
|
68
|
-
3. Re-create the git notes for each release tag, e.g. `git notes --ref semantic-release add -f -m '{"channels":["beta"]}'
|
|
68
|
+
3. Re-create the git notes for each release tag, e.g. `git notes --ref semantic-release add -f -m '{"channels":["beta"]}' v2.0.0-beta.1`. If the release was also published in the default channel (usually `master`), then set the first channel to `null`, e.g. `git notes --ref semantic-release add -f -m '{"channels":[null, "beta"]}'
|
|
69
69
|
4. Push the local notes: `git push --force origin refs/notes/semantic-release`. The `--force` is needed after the rebase. Be careful.
|
package/docs/usage/plugins.md
CHANGED
|
@@ -16,6 +16,8 @@ A plugin is a npm module that can implement one or more of the following steps:
|
|
|
16
16
|
| `success` | No | Responsible for notifying of a new release. |
|
|
17
17
|
| `fail` | No | Responsible for notifying of a failed release. |
|
|
18
18
|
|
|
19
|
+
Release steps will run in that order. At each step, **semantic-release** will run every plugin in the [`plugins` array](#plugins-declaration-and-execution-order), as long as the plugin implements the step.
|
|
20
|
+
|
|
19
21
|
**Note:** If no plugin with a `analyzeCommits` step is defined `@semantic-release/commit-analyzer` will be used.
|
|
20
22
|
|
|
21
23
|
## Plugins installation
|
|
@@ -70,6 +72,8 @@ With this configuration **semantic-release** will:
|
|
|
70
72
|
- execute the `prepare` implementation of `@semantic-release/npm` then `@semantic-release/git`
|
|
71
73
|
- execute the `publish` implementation of `@semantic-release/npm`
|
|
72
74
|
|
|
75
|
+
Order is first determined by release steps (such as `verifyConditions` → `anayzeCommits`). At each release step, plugins are executed in the order in which they are defined.
|
|
76
|
+
|
|
73
77
|
## Plugin options configuration
|
|
74
78
|
|
|
75
79
|
A plugin configuration can be specified by wrapping the name and an options object in an array. Options configured this way will be passed only to that specific plugin.
|
|
@@ -13,7 +13,7 @@ Each branch can be defined either as a string, a [glob](https://github.com/micro
|
|
|
13
13
|
|
|
14
14
|
A branch can defined as one of three types:
|
|
15
15
|
- [release](#release-branches): to make releases on top of the last version released
|
|
16
|
-
- [maintenance](#maintenance-branches): to make
|
|
16
|
+
- [maintenance](#maintenance-branches): to make releases on top of an old release
|
|
17
17
|
- [pre-release](#pre-release-branches): to make pre-releases
|
|
18
18
|
|
|
19
19
|
The type of the branch is automatically determined based on naming convention and/or [properties](#branches-properties).
|
|
@@ -25,7 +25,7 @@ The type of the branch is automatically determined based on naming convention an
|
|
|
25
25
|
| `name` | All | **Required.** The Git branch holding the commits to analyze and the code to release. See [name](#name). | - The value itself if defined as a `String` or the matching branches name if defined as a glob. |
|
|
26
26
|
| `channel` | All | The distribution channel on which to publish releases from this branch. Set to `false` to force the default distribution channel instead of using the default. See [channel](#channel). | `undefined` for the first release branch, the value of `name` for subsequent ones. |
|
|
27
27
|
| `range` | [maintenance](#maintenance-branches) only | **Required unless `name` is formatted like `N.N.x` or `N.x` (`N` is a number).** The range of [semantic versions](https://semver.org) to support on this branch. See [range](#range). | The value of `name`. |
|
|
28
|
-
| `prerelease` | [pre-release](#pre-release-branches) only | **Required.** The pre-release
|
|
28
|
+
| `prerelease` | [pre-release](#pre-release-branches) only | **Required.** The pre-release denotation to append to [semantic versions](https://semver.org) released from this branch. See [prerelease](#prerelease). | - |
|
|
29
29
|
|
|
30
30
|
### name
|
|
31
31
|
|
|
@@ -162,7 +162,7 @@ With the configuration `"branches": ["1.0.x", "1.x", "master"]`, if the last rel
|
|
|
162
162
|
### Pre-release branches
|
|
163
163
|
|
|
164
164
|
A pre-release branch is a type of branch used by **semantic-release** that allows to publish releases with a [pre-release version](https://semver.org/#spec-item-9).
|
|
165
|
-
Using a pre-release version allow to publish multiple releases with the same version. Those release will be differentiated via
|
|
165
|
+
Using a pre-release version allow to publish multiple releases with the same version. Those release will be differentiated via their identifiers (in `1.0.0-alpha.1` the identifier is `alpha.1`).
|
|
166
166
|
This is useful when you need to work on a future major release that will include many breaking changes but you do not want to increment the version number for each breaking change commit.
|
|
167
167
|
|
|
168
168
|
A pre-release branch is characterized by the `prerelease` property that defines the static part of the version released (in `1.0.0-alpha.1` the static part fo the identifier is `alpha`). The [`prerelease`](#prerelease) value of each pre-release branch must be unique across the project.
|
|
@@ -60,7 +60,7 @@ Your configuration for the \`tagFormat\` option is \`${stringify(tagFormat)}\`.`
|
|
|
60
60
|
message: `The \`${type}\` plugin configuration is invalid.`,
|
|
61
61
|
details: `The [${type} plugin configuration](${linkify(`docs/usage/plugins.md#${toLower(type)}-plugin`)}) ${
|
|
62
62
|
required ? 'is required and ' : ''
|
|
63
|
-
} must be a single or an array of plugins definition. A plugin definition is an npm module name,
|
|
63
|
+
} must be a single or an array of plugins definition. A plugin definition is an npm module name, optionally wrapped in an array with an object.
|
|
64
64
|
|
|
65
65
|
Your configuration for the \`${type}\` plugin is \`${stringify(pluginConf)}\`.`,
|
|
66
66
|
}),
|
|
@@ -68,7 +68,7 @@ Your configuration for the \`${type}\` plugin is \`${stringify(pluginConf)}\`.`,
|
|
|
68
68
|
message: 'The `plugins` configuration is invalid.',
|
|
69
69
|
details: `The [plugins](${linkify(
|
|
70
70
|
'docs/usage/configuration.md#plugins'
|
|
71
|
-
)}) option must be an array of plugin definions. A plugin definition is an npm module name,
|
|
71
|
+
)}) option must be an array of plugin definions. A plugin definition is an npm module name, optionally wrapped in an array with an object.
|
|
72
72
|
|
|
73
73
|
The invalid configuration is \`${stringify(plugin)}\`.`,
|
|
74
74
|
}),
|
package/lib/git.js
CHANGED
|
@@ -318,7 +318,7 @@ async function getNote(ref, execaOptions) {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
/**
|
|
321
|
-
*
|
|
321
|
+
* Add JSON note to a given reference.
|
|
322
322
|
*
|
|
323
323
|
* @param {Object} note The object to save in the reference note.
|
|
324
324
|
* @param {String} ref The Git reference to add the note to.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-release",
|
|
3
3
|
"description": "Automated semver compliant package publishing",
|
|
4
|
-
"version": "17.4.
|
|
4
|
+
"version": "17.4.5",
|
|
5
5
|
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
|
6
6
|
"ava": {
|
|
7
7
|
"files": [
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"get-stream": "^6.0.0",
|
|
36
36
|
"git-log-parser": "^1.2.0",
|
|
37
37
|
"hook-std": "^2.0.0",
|
|
38
|
-
"hosted-git-info": "^
|
|
39
|
-
"lodash": "^4.17.
|
|
40
|
-
"marked": "^
|
|
38
|
+
"hosted-git-info": "^4.0.0",
|
|
39
|
+
"lodash": "^4.17.21",
|
|
40
|
+
"marked": "^3.0.0",
|
|
41
41
|
"marked-terminal": "^4.1.1",
|
|
42
42
|
"micromatch": "^4.0.2",
|
|
43
43
|
"p-each-series": "^2.1.0",
|
|
@@ -52,21 +52,21 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"ava": "3.15.0",
|
|
54
54
|
"clear-module": "4.1.1",
|
|
55
|
-
"codecov": "3.8.
|
|
55
|
+
"codecov": "3.8.2",
|
|
56
56
|
"delay": "5.0.0",
|
|
57
|
-
"dockerode": "3.
|
|
57
|
+
"dockerode": "3.3.0",
|
|
58
58
|
"file-url": "3.0.0",
|
|
59
|
-
"fs-extra": "
|
|
60
|
-
"got": "11.8.
|
|
61
|
-
"js-yaml": "
|
|
59
|
+
"fs-extra": "10.0.0",
|
|
60
|
+
"got": "11.8.2",
|
|
61
|
+
"js-yaml": "4.1.0",
|
|
62
62
|
"mockserver-client": "5.11.2",
|
|
63
|
-
"nock": "13.
|
|
63
|
+
"nock": "13.1.1",
|
|
64
64
|
"nyc": "15.1.0",
|
|
65
|
-
"p-retry": "4.
|
|
65
|
+
"p-retry": "4.6.1",
|
|
66
66
|
"proxyquire": "2.1.3",
|
|
67
|
-
"sinon": "
|
|
67
|
+
"sinon": "11.1.1",
|
|
68
68
|
"stream-buffers": "3.0.2",
|
|
69
|
-
"tempy": "1.0.
|
|
69
|
+
"tempy": "1.0.1",
|
|
70
70
|
"xo": "0.29.1"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|