semantic-release 17.4.3 → 17.4.7
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 +2 -2
- package/docs/developer-guide/plugin.md +35 -3
- package/docs/extending/plugins-list.md +13 -0
- package/docs/recipes/circleci-workflows.md +16 -23
- package/docs/recipes/github-actions.md +3 -3
- package/docs/recipes/gitlab-ci.md +2 -2
- package/docs/recipes/jenkins-ci.md +5 -5
- package/docs/recipes/maintenance-releases.md +2 -2
- package/docs/recipes/travis.md +3 -3
- package/docs/support/FAQ.md +4 -34
- package/docs/support/node-support-policy.md +1 -1
- package/docs/support/node-version.md +8 -8
- package/docs/usage/installation.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/package.json +9 -9
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
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
|
|
@@ -97,7 +97,7 @@ In order to use **semantic-release** you need:
|
|
|
97
97
|
- To host your code in a [Git repository](https://git-scm.com)
|
|
98
98
|
- Use a Continuous Integration service that allows you to [securely set up credentials](docs/usage/ci-configuration.md#authentication)
|
|
99
99
|
- Git CLI version [2.7.1 or higher](docs/support/FAQ.md#why-does-semantic-release-require-git-version--271) installed in your Continuous Integration environment
|
|
100
|
-
- [Node.js](https://nodejs.org) version [10.
|
|
100
|
+
- [Node.js](https://nodejs.org) version [10.19 or higher](docs/support/FAQ.md#why-does-semantic-release-require-node-version--1019) installed in your Continuous Integration environment
|
|
101
101
|
|
|
102
102
|
## Documentation
|
|
103
103
|
|
|
@@ -183,9 +183,14 @@ Compared to the verifyConditions, `analyzeCommits` lifecycle context has keys
|
|
|
183
183
|
|
|
184
184
|
Additional keys:
|
|
185
185
|
|
|
186
|
-
* `nextRelease`
|
|
187
|
-
*
|
|
188
|
-
|
|
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
|
+
|
|
189
194
|
#### generateNotes
|
|
190
195
|
|
|
191
196
|
No new content in the context.
|
|
@@ -232,3 +237,30 @@ if (env.GITHUB_TOKEN) {
|
|
|
232
237
|
//...
|
|
233
238
|
}
|
|
234
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.
|
|
@@ -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
|
|
@@ -10,11 +10,11 @@ In this example a publish type [`NPM_TOKEN`](https://docs.npmjs.com/creating-and
|
|
|
10
10
|
|
|
11
11
|
[GitHub Actions](https://github.com/features/actions) support [Workflows](https://help.github.com/en/articles/configuring-workflows), allowing to run tests on multiple Node versions and publish a release only when all test pass.
|
|
12
12
|
|
|
13
|
-
**Note**: The publish pipeline must run on [Node version >= 10.
|
|
13
|
+
**Note**: The publish pipeline must run on [Node version >= 10.19](../support/FAQ.md#why-does-semantic-release-require-node-version--1019).
|
|
14
14
|
|
|
15
15
|
### `.github/workflows/release.yml` configuration for Node projects
|
|
16
16
|
|
|
17
|
-
The following is a minimal configuration for [`semantic-release`](https://github.com/semantic-release/semantic-release) with a build running on Node
|
|
17
|
+
The following is a minimal configuration for [`semantic-release`](https://github.com/semantic-release/semantic-release) with a build running on Node 10.19 when a new commit is pushed to a `master` branch. See [Configuring a Workflow](https://help.github.com/en/articles/configuring-a-workflow) for additional configuration options.
|
|
18
18
|
|
|
19
19
|
```yaml
|
|
20
20
|
name: Release
|
|
@@ -34,7 +34,7 @@ jobs:
|
|
|
34
34
|
- name: Setup Node.js
|
|
35
35
|
uses: actions/setup-node@v1
|
|
36
36
|
with:
|
|
37
|
-
node-version:
|
|
37
|
+
node-version: '10.19'
|
|
38
38
|
- name: Install dependencies
|
|
39
39
|
run: npm ci
|
|
40
40
|
- name: Release
|
|
@@ -10,7 +10,7 @@ The [Authentication](../usage/ci-configuration.md#authentication) environment va
|
|
|
10
10
|
|
|
11
11
|
GitLab CI supports [Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html) allowing to test on multiple Node versions and publishing a release only when all test pass.
|
|
12
12
|
|
|
13
|
-
**Note**: The publish pipeline must run a [Node >= 10.
|
|
13
|
+
**Note**: The publish pipeline must run a [Node >= 10.19 version](../support/FAQ.md#why-does-semantic-release-require-node-version--1019).
|
|
14
14
|
|
|
15
15
|
### `.gitlab-ci.yml` configuration for Node projects
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ This example is a minimal configuration for **semantic-release** with a build ru
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
```yaml
|
|
57
|
-
# The release pipeline will run only on the master branch a commit is triggered
|
|
57
|
+
# The release pipeline will run only on the master branch a commit is triggered
|
|
58
58
|
stages:
|
|
59
59
|
- release
|
|
60
60
|
|
|
@@ -10,7 +10,7 @@ Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with
|
|
|
10
10
|
|
|
11
11
|
### `Jenkinsfile (Declarative Pipeline)` configuration for a Node.js job
|
|
12
12
|
|
|
13
|
-
**Note**: The publish pipeline must run a [Node >= 10.
|
|
13
|
+
**Note**: The publish pipeline must run a [Node >= 10.19 version](../support/FAQ.md#why-does-semantic-release-require-node-version--1019).
|
|
14
14
|
|
|
15
15
|
This example is a minimal configuration for **semantic-release** with a build running Node 10.18. See [Jenkins documentation](https://www.jenkins.io/doc/) for additional configuration options.
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ The`semantic-release` execution command varies depending if you are using a [loc
|
|
|
19
19
|
```yaml
|
|
20
20
|
// The release stage in the pipeline will run only if the test stage in the pipeline is successful
|
|
21
21
|
pipeline {
|
|
22
|
-
agent any
|
|
22
|
+
agent any
|
|
23
23
|
environment {
|
|
24
24
|
GH_TOKEN = credentials('some-id')
|
|
25
25
|
}
|
|
@@ -35,14 +35,14 @@ pipeline {
|
|
|
35
35
|
}
|
|
36
36
|
stage('Release') {
|
|
37
37
|
tools {
|
|
38
|
-
nodejs "node 10.
|
|
38
|
+
nodejs "node 10.19"
|
|
39
39
|
}
|
|
40
40
|
steps {
|
|
41
41
|
sh '''
|
|
42
42
|
# Run optional required steps before releasing
|
|
43
43
|
npx semantic-release
|
|
44
44
|
'''
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -58,4 +58,4 @@ A `package.json` is required only for [local](../usage/installation.md#local-ins
|
|
|
58
58
|
"semantic-release": "^15.0.0"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
```
|
|
61
|
+
```
|
|
@@ -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
|
|
package/docs/recipes/travis.md
CHANGED
|
@@ -10,7 +10,7 @@ Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with
|
|
|
10
10
|
|
|
11
11
|
### `.travis.yml` configuration for multiple Node.js jobs
|
|
12
12
|
|
|
13
|
-
This example is a minimal configuration for **semantic-release** with a build running Node
|
|
13
|
+
This example is a minimal configuration for **semantic-release** with a build running Node 10 and 12. See [Travis - Customizing the Build](https://docs.travis-ci.com/user/customizing-the-build) for additional configuration options.
|
|
14
14
|
|
|
15
15
|
This example creates a `release` [build stage](https://docs.travis-ci.com/user/build-stages) that [runs `semantic-release` only after all test jobs are successful](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
16
16
|
|
|
@@ -24,8 +24,8 @@ It's recommended to run the `semantic-release` command in the [Travis `deploy` s
|
|
|
24
24
|
language: node_js
|
|
25
25
|
|
|
26
26
|
node_js:
|
|
27
|
-
-
|
|
28
|
-
-
|
|
27
|
+
- 10
|
|
28
|
+
- 12
|
|
29
29
|
|
|
30
30
|
jobs:
|
|
31
31
|
include:
|
package/docs/support/FAQ.md
CHANGED
|
@@ -38,44 +38,14 @@ If using npm hook scripts is not possible, and alternative solution is to [`@sem
|
|
|
38
38
|
|
|
39
39
|
Yes with the [dry-run options](../usage/configuration.md#dryrun) which prints to the console the next version to be published and the release notes.
|
|
40
40
|
|
|
41
|
-
## Can I use semantic-release with Yarn?
|
|
42
|
-
|
|
43
|
-
If you are using a [local](../usage/installation.md#local-installation) **semantic-release** installation and run multiple CI jobs with different versions, the `yarn install` command will fail on jobs running with Node < 8 as **semantic-release** requires [Node >= 10.18](#why-does-semantic-release-require-node-version--1018) and specifies it in its `package.json`s [`engines`](https://docs.npmjs.com/files/package.json#engines) key.
|
|
44
|
-
|
|
45
|
-
The recommended solution is to use the [Yarn](https://yarnpkg.com) [--ignore-engines](https://yarnpkg.com/en/docs/cli/install#toc-yarn-install-ignore-engines) option to install the project dependencies on the CI environment, so Yarn will ignore the **semantic-release**'s `engines` key:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
$ yarn install --ignore-engines
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**Note**: Several CI services use Yarn by default if your repository contains a `yarn.lock` file. So you should override the install step to specify `yarn install --ignore-engines`.
|
|
52
|
-
|
|
53
|
-
Alternatively you can use a [global](../usage/installation.md#global-installation) **semantic-release** installation and make sure to install and run the `semantic-release` command only in a CI jobs running with Node >= 10.18.
|
|
54
|
-
|
|
55
|
-
If your CI environment provides [nvm](https://github.com/creationix/nvm) you can switch to Node 8 before installing and running the `semantic-release` command:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
$ nvm install 8 && yarn global add semantic-release && semantic-release
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
See the [CI configuration recipes](../recipes/README.md#ci-configurations) for more details on specific CI environments.
|
|
62
|
-
|
|
63
|
-
As `semantic-release` is recommended to be executed with [`npx`](https://www.npmjs.com/package/npx) an alternative is required for usage with Yarn. Even though it is possible to install npx with Yarn, it's not recommended. Yarn and npx would be using different cache locations.
|
|
64
|
-
|
|
65
|
-
For [local installation](../usage/installation.md#local-installation) replace
|
|
66
|
-
`npx semantic-release` with `yarn run semantic-release`.
|
|
67
|
-
|
|
68
|
-
For [global installation](../usage/installation.md#global-installation) replace
|
|
69
|
-
`npx semantic-release` with `yarn global add semantic-release && semantic-release`.
|
|
70
|
-
|
|
71
41
|
## Can I use semantic-release to publish non-JavaScript packages?
|
|
72
42
|
|
|
73
|
-
Yes, **semantic-release** is a Node CLI application but it can be used to publish any type of packages.
|
|
43
|
+
Yes, **semantic-release** is a Node CLI application, but it can be used to publish any type of packages.
|
|
74
44
|
|
|
75
45
|
To publish a non-Node package (without a `package.json`) you would need to:
|
|
76
46
|
- Use a [global](../usage/installation.md#global-installation) **semantic-release** installation
|
|
77
47
|
- Set **semantic-release** [options](../usage/configuration.md#options) via [CLI arguments or rc file](../usage/configuration.md#configuration)
|
|
78
|
-
- Make sure your CI job executing the `semantic-release` command has access to [Node >= 10.
|
|
48
|
+
- Make sure your CI job executing the `semantic-release` command has access to [Node >= 10.19](#why-does-semantic-release-require-node-version--1019) to execute the `semantic-release` command
|
|
79
49
|
|
|
80
50
|
See the [CI configuration recipes](../recipes/README.md#ci-configurations) for more details on specific CI environments.
|
|
81
51
|
|
|
@@ -234,9 +204,9 @@ See [“Introduction to SemVer” - Irina Gebauer](https://blog.greenkeeper.io/i
|
|
|
234
204
|
|
|
235
205
|
In addition the [verify conditions step](../../README.md#release-steps) verifies that all necessary conditions for proceeding with a release are met, and a new release will be performed [only if all your tests pass](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
|
|
236
206
|
|
|
237
|
-
## Why does semantic-release require Node version >= 10.
|
|
207
|
+
## Why does semantic-release require Node version >= 10.19?
|
|
238
208
|
|
|
239
|
-
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 10.
|
|
209
|
+
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 10.19 or higher**.
|
|
240
210
|
|
|
241
211
|
See [Node version requirement](./node-version.md#node-version-requirement) for more details and solutions.
|
|
242
212
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Node Support Policy
|
|
2
2
|
|
|
3
|
-
We only support [Long-Term Support](https://github.com/nodejs/Release) versions of Node starting with [Node
|
|
3
|
+
We only support [Long-Term Support](https://github.com/nodejs/Release) versions of Node starting with [Node 10.19 (LTS)](https://nodejs.org/en/blog/release/v10.19.0).
|
|
4
4
|
|
|
5
5
|
We specifically limit our support to LTS versions of Node, not because this package won't work on other versions, but because we have a limited amount of time, and supporting LTS offers the greatest return on that investment.
|
|
6
6
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# Node version requirement
|
|
2
2
|
|
|
3
|
-
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which
|
|
3
|
+
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 10.19 or higher**.
|
|
4
4
|
|
|
5
|
-
**semantic-release** is meant to be used in a CI environment as a development support tool, not as a production dependency. Therefore the only constraint is to run the `semantic-release` in a CI environment providing Node
|
|
5
|
+
**semantic-release** is meant to be used in a CI environment as a development support tool, not as a production dependency. Therefore, the only constraint is to run the `semantic-release` in a CI environment providing Node 10.19 or higher.
|
|
6
6
|
|
|
7
7
|
See our [Node Support Policy](node-support-policy.md) for our long-term promise regarding Node version support.
|
|
8
8
|
|
|
9
9
|
## Recommended solution
|
|
10
10
|
|
|
11
|
-
### Run at least one CI job with Node >= 10.
|
|
11
|
+
### Run at least one CI job with Node >= 10.19
|
|
12
12
|
|
|
13
|
-
The recommended approach is to run the `semantic-release` command from a CI job running on Node 10.
|
|
13
|
+
The recommended approach is to run the `semantic-release` command from a CI job running on Node 10.19 or higher. This can either be a job used by your project to test on Node >= 10.19 or a dedicated job for the release steps.
|
|
14
14
|
|
|
15
15
|
See [CI configuration](../usage/ci-configuration.md) and [CI configuration recipes](../recipes/README.md#ci-configurations) for more details.
|
|
16
16
|
|
|
@@ -18,18 +18,18 @@ See [CI configuration](../usage/ci-configuration.md) and [CI configuration recip
|
|
|
18
18
|
|
|
19
19
|
### Use `npx`
|
|
20
20
|
|
|
21
|
-
`npx` is included with npm >= 5.2 and can be used to download the latest [Node
|
|
21
|
+
`npx` is included with npm >= 5.2 and can be used to download the latest [Node 10 package published on npm](https://www.npmjs.com/package/node). Use it to execute the `semantic-release` command.
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
$ npx -p node@
|
|
24
|
+
$ npx -p node@10 -c "npx semantic-release"
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
**Note:**: See [What is npx](./FAQ.md#what-is-npx) for more details.
|
|
28
28
|
|
|
29
29
|
### Use `nvm`
|
|
30
30
|
|
|
31
|
-
If your CI environment provides [nvm](https://github.com/creationix/nvm) you can use it to switch to Node
|
|
31
|
+
If your CI environment provides [nvm](https://github.com/creationix/nvm) you can use it to switch to Node 10.19 before running the `semantic-release` command.
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
$ nvm install
|
|
34
|
+
$ nvm install 10.19 && npx semantic-release
|
|
35
35
|
```
|
|
@@ -24,6 +24,6 @@ For other type of projects we recommend installing **semantic-release** directly
|
|
|
24
24
|
$ npx semantic-release
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
**Note**: For a global installation, it's recommended to specify the major **semantic-release** version to install (for example with with `npx semantic-release@
|
|
27
|
+
**Note**: For a global installation, it's recommended to specify the major **semantic-release** version to install (for example with with `npx semantic-release@17`). This way your build will not automatically use the next major **semantic-release** release that could possibly break your build. You will have to upgrade manually when a new major version is released.
|
|
28
28
|
|
|
29
29
|
**Note**: `npx` is a tool bundled with `npm@>=5.2.0`. It is used to conveniently install the semantic-release binary and to execute it. See [What is npx](../support/FAQ.md#what-is-npx) for more details.
|
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/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.7",
|
|
5
5
|
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
|
6
6
|
"ava": {
|
|
7
7
|
"files": [
|
|
@@ -52,25 +52,25 @@
|
|
|
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
59
|
"fs-extra": "9.1.0",
|
|
60
60
|
"got": "11.8.2",
|
|
61
|
-
"js-yaml": "
|
|
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": {
|
|
73
|
-
"node": ">=10.
|
|
73
|
+
"node": ">=10.19"
|
|
74
74
|
},
|
|
75
75
|
"files": [
|
|
76
76
|
"bin",
|