semantic-release / Npm

Licence: mit
🚢 semantic-release plugin to publish a npm package

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Npm

Cli
🆑📍 Setup automated semver compliant package publishing
Stars: ✭ 272 (+164.08%)
Mutual labels:  version, publish, release
Github
semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues
Stars: ✭ 159 (+54.37%)
Mutual labels:  version, publish, release
Release It
🚀 Automate versioning and package publishing
Stars: ✭ 4,773 (+4533.98%)
Mutual labels:  publish, release, npm
Semantic Release
📦🚀 Fully automated version management and package publishing
Stars: ✭ 14,364 (+13845.63%)
Mutual labels:  version, publish, release
Automatic Release
Automates the release process for GitHub projects.
Stars: ✭ 46 (-55.34%)
Mutual labels:  publish, release, npm
exec
🐚 semantic-release plugin to execute custom shell commands
Stars: ✭ 94 (-8.74%)
Mutual labels:  version, release, publish
Bump
Bump updates the project's version, updates/creates the changelog, makes the bump commit, tags the bump commit and makes the release to GitHub. Opinionated but configurable.
Stars: ✭ 327 (+217.48%)
Mutual labels:  version, release
Cnpmjs.org
Private npm registry and web for Enterprise
Stars: ✭ 3,536 (+3333.01%)
Mutual labels:  registry, npm
Codebox Npm
Serverless private npm registry using https://serverless.com/
Stars: ✭ 340 (+230.1%)
Mutual labels:  registry, npm
Condition Travis
🚫 semantic-release plugin to check Travis CI environment before publishing.
Stars: ✭ 9 (-91.26%)
Mutual labels:  publish, release
Open Registry
Community Owned JavaScript Registry
Stars: ✭ 259 (+151.46%)
Mutual labels:  registry, npm
Standard Version
🏆 Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
Stars: ✭ 5,806 (+5536.89%)
Mutual labels:  version, release
Release Man
听说你发新版总忘记打 Tag 和改 package.json?
Stars: ✭ 14 (-86.41%)
Mutual labels:  publish, npm
Wasm Pack
This tool seeks to be a one-stop shop for building and working with rust- generated WebAssembly that you would like to interop with JavaScript, in the browser or with Node.js. wasm-pack helps you build rust-generated WebAssembly packages that you could publish to the npm registry, or otherwise use alongside any javascript packages in workflows that you already use, such as webpack.
Stars: ✭ 3,848 (+3635.92%)
Mutual labels:  registry, npm
Python Semver
Python package to work with Semantic Versioning (http://semver.org/)
Stars: ✭ 264 (+156.31%)
Mutual labels:  version, release
Np
A better `npm publish`
Stars: ✭ 6,401 (+6114.56%)
Mutual labels:  publish, npm
Metav
Release and Versioning of Clojure projects using tools.deps
Stars: ✭ 62 (-39.81%)
Mutual labels:  version, release
Npm Api
Node.js library for getting info from NPM’s API
Stars: ✭ 67 (-34.95%)
Mutual labels:  registry, npm
Enseada
A Cloud native multi-package registry
Stars: ✭ 80 (-22.33%)
Mutual labels:  registry, npm
available-versions
Returns a promise with new versions higher than given for a npm module
Stars: ✭ 18 (-82.52%)
Mutual labels:  registry, version

@semantic-release/npm

semantic-release plugin to publish a npm package.

Build Status npm latest version npm next version npm beta version

Step Description
verifyConditions Verify the presence of the NPM_TOKEN environment variable, create or update the .npmrc file with the token and verify the token is valid.
prepare Update the package.json version and create the npm package tarball.
addChannel Add a release to a dist-tag.
publish Publish the npm package to the registry.

Install

$ npm install @semantic-release/npm -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
  ]
}

Configuration

Npm registry authentication

The npm authentication configuration is required and can be set via environment variables.

Both the token and the legacy (username, password and email) authentication are supported. It is recommended to use the token authentication. The legacy authentication is supported as the alternative npm registries Artifactory and npm-registry-couchapp only supports that form of authentication.

Note: Only the auth-only level of npm two-factor authentication is supported, semantic-release will not work with the default auth-and-writes level.

Environment variables

Variable Description
NPM_TOKEN Npm token created via npm token create
NPM_USERNAME Npm username created via npm adduser or on npmjs.com
NPM_PASSWORD Password of the npm user.
NPM_EMAIL Email address associated with the npm user

Use either NPM_TOKEN for token authentication or NPM_USERNAME, NPM_PASSWORD and NPM_EMAIL for legacy authentication

Options

Options Description Default
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 property is true, true otherwise.
pkgRoot Directory path to publish. .
tarballDir Directory path in which to write the the package tarball. If false the tarball is not be kept on the file system. false

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.

Note: If you use a shareable configuration that defines one of these options you can set it to false in your semantic-release configuration in order to use the default value.

Npm configuration

The plugin uses the npm CLI which will read the configuration from .npmrc. See npm config for the option list.

The registry can be configured via the npm environment variable NPM_CONFIG_REGISTRY and will take precedence over the configuration in .npmrc.

The registry and dist-tag can be configured in the package.json and will take precedence over the configuration in .npmrc and NPM_CONFIG_REGISTRY:

{
  "publishConfig": {
    "registry": "https://registry.npmjs.org/",
    "tag": "latest"
  }
}

Examples

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",
    ["@semantic-release/npm", {
      "npmPublish": false,
      "tarballDir": "dist",
    }],
    ["@semantic-release/github", {
      "assets": "dist/*.tgz"
    }]
  ]
}

When publishing from a sub-directory with the pkgRoot option, the package.json and npm-shrinkwrap.json updated with the new version can be moved to another directory with a postpublish npm script. For example with the @semantic-release/git plugin:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/npm", {
      "pkgRoot": "dist",
    }],
    ["@semantic-release/git", {
      "assets": ["package.json", "npm-shrinkwrap.json"]
    }]
  ]
}
{
  "scripts": {
    "postversion": "cp -r package.json .. && cp -r npm-shrinkwrap.json .."
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].