You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`verifyConditions`| Verify the presence of the `NPM_TOKEN` environment variable, or an `.npmrc` file, and verify the authentication method is valid. |
12
-
|`prepare`| Update the `package.json` version and [create](https://docs.npmjs.com/cli/pack) the npm package tarball. |
13
-
|`addChannel`|[Add a release to a dist-tag](https://docs.npmjs.com/cli/dist-tag). |
14
-
|`publish`|[Publish the npm package](https://docs.npmjs.com/cli/publish) to the registry. |
12
+
|`prepare`| Update the `package.json` version and [create](https://docs.npmjs.com/cli/pack) the npm package tarball. |
13
+
|`addChannel`|[Add a release to a dist-tag](https://docs.npmjs.com/cli/dist-tag). |
14
+
|`publish`|[Publish the npm package](https://docs.npmjs.com/cli/publish) to the registry. |
15
15
16
16
## Install
17
17
@@ -25,11 +25,7 @@ The plugin can be configured in the [**semantic-release** configuration file](ht
@@ -42,6 +38,7 @@ The npm authentication configuration is **required** and can be set via [environ
42
38
Both the [token](https://docs.npmjs.com/getting-started/working_with_tokens) and the legacy (`username`, `password` and `email`) authentication are supported. It is recommended to use the [token](https://docs.npmjs.com/getting-started/working_with_tokens) authentication. The legacy authentication is supported as the alternative npm registries [Artifactory](https://www.jfrog.com/open-source/#os-arti) and [npm-registry-couchapp](https://github.com/npm/npm-registry-couchapp) only supports that form of authentication.
43
39
44
40
**Notes**:
41
+
45
42
- 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, **semantic-release** will not work with the default `auth-and-writes` level.
46
43
- The presence of an `.npmrc` file will override any specified environment variables.
47
44
@@ -50,20 +47,15 @@ Both the [token](https://docs.npmjs.com/getting-started/working_with_tokens) and
|`npmPublish`| Whether to publish the `npm` package to the registry. If `false` the `package.json` version will still be updated. |`false` if the `package.json`[private](https://docs.npmjs.com/files/package.json#private) property is `true`, `true` otherwise. |
65
-
|`pkgRoot`| Directory path to publish. |`.`|
66
-
|`tarballDir`| Directory path in which to write the package tarball. If `false` the tarball is not be kept on the file system. |`false`|
|`npmPublish`| Whether to publish the `npm` package to the registry. If `false` the `package.json` version will still be updated. |`false` if the `package.json`[private](https://docs.npmjs.com/files/package.json#private) property is `true`, `true` otherwise. |
57
+
|`pkgRoot`| Directory path to publish. |`.`|
58
+
|`tarballDir`| Directory path in which to write the package tarball. If `false` the tarball is not be kept on the file system. |`false`|
67
59
68
60
**Note**: The `pkgRoot` directory must contain a `package.json`. The version will be updated only in the `package.json` and `npm-shrinkwrap.json` within the `pkgRoot` directory.
69
61
@@ -76,6 +68,7 @@ The plugin uses the [`npm` CLI](https://github.com/npm/cli) which will read the
76
68
The [`registry`](https://docs.npmjs.com/misc/registry) can be configured via the npm environment variable `NPM_CONFIG_REGISTRY` and will take precedence over the configuration in `.npmrc`.
77
69
78
70
The [`registry`](https://docs.npmjs.com/misc/registry) and [`dist-tag`](https://docs.npmjs.com/cli/dist-tag) can be configured in the `package.json` and will take precedence over the configuration in `.npmrc` and `NPM_CONFIG_REGISTRY`:
71
+
79
72
```json
80
73
{
81
74
"publishConfig": {
@@ -94,13 +87,19 @@ The `npmPublish` and `tarballDir` option can be used to skip the publishing to t
94
87
"plugins": [
95
88
"@semantic-release/commit-analyzer",
96
89
"@semantic-release/release-notes-generator",
97
-
["@semantic-release/npm", {
98
-
"npmPublish": false,
99
-
"tarballDir": "dist",
100
-
}],
101
-
["@semantic-release/github", {
102
-
"assets": "dist/*.tgz"
103
-
}]
90
+
[
91
+
"@semantic-release/npm",
92
+
{
93
+
"npmPublish": false,
94
+
"tarballDir": "dist"
95
+
}
96
+
],
97
+
[
98
+
"@semantic-release/github",
99
+
{
100
+
"assets": "dist/*.tgz"
101
+
}
102
+
]
104
103
]
105
104
}
106
105
```
@@ -112,15 +111,22 @@ When publishing from a sub-directory with the `pkgRoot` option, the `package.jso
// If the npm publish plugin is used and has `npmPublish`, `tarballDir` or `pkgRoot` configured, validate them now in order to prevent any release if the configuration is wrong
0 commit comments