semantic-release plugin to publish a npm package using yarn@berry.
Step | Description |
---|---|
verifyConditions |
Verify the presence of the NPM_TOKEN environment variable and verify the authentication method is valid. |
prepare |
Update the package.json version and create the npm package tarball. |
publish |
Publish the npm package to the registry. |
$ yarn add @suin/semantic-release-yarn -D
The plugin can be configured in the semantic-release configuration file:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@suin/semantic-release-yarn"
]
}
The npm authentication configuration is required and can be set via environment variables.
The token is supported.
Notes:
- Only the
auth-only
level of npm two-factor authentication is supported, semantic-release will not work with the defaultauth-and-writes
level.
Variable | Description |
---|---|
NPM_TOKEN |
Npm token created via npm token create |
See PluginConfig
type declaration.
The plugin uses the yarn@berry
CLI which will read the configuration from .yarnrc.yml
.
Notes:
- The plugin currently only supports the NPM registry
https://registry.npmjs.org
. - The plugin require yarn version plugin. You don't have to install it manually, the plugin will install it for you.
The npmPublish
and tarballDir
option can be used to skip the publishing to the npm
registry and instead, release the package tarball with another plugin. For example with the @semantic-release/github plugin:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@suin/semantic-release-yarn",
{
"npmPublish": false,
"tarballDir": "dist"
}
],
[
"@semantic-release/github",
{
"assets": "dist/*.tgz"
}
]
]
}