0.1.5 • Published 2 years ago

@octorelease/npm v0.1.5

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

NPM plugin

Octorelease plugin to perform actions related to NPM.

Build Status npm latest version

StepDescription
initLoad version numbers from package.json and login to NPM registry.
versionBump the package version with npm CLI.
publishPublish the new package version to NPM registry.
successVerify that new package version can be installed successfully.

Install

$ npm install @octorelease/npm -D

Usage

The plugin can be configured in the Octorelease configuration file:

{
  "plugins": [
    "@octorelease/npm"
  ]
}

Configuration

Environment variables

VariableDescription
NPM_TOKENAccess token of the NPM publisher.
NPM_USERNAMEUser name of the NPM publisher.
NPM_PASSWORDPassword of the NPM publisher.
NPM_EMAILEmail address of the NPM publisher.

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

Options

OptionsDescriptionDefault
aliasTagsKey-value pairs of package tags that should be mirrored (see example below).{}
npmPublishSpecify false to skip publishing to the NPM registry.true
pruneShrinkwrapSpecify true to prune dev and extraneous dependencies from npm-shrinkwrap.json.false
smokeTestSpecify true to test installing the package from the NPM registry after it is published.false
tarballDirPath to directory where package tarball (TGZ) should be generated, or false to skip creating a tarball.false

Examples

To mirror the @latest tag to @lts:

{
  "plugins": [
    ["@octorelease/npm", {
      "aliasTags": {
        "latest": "lts"
      }
    }]
  ]
}

To skip publishing to the NPM registry and release the package tarball with another plugin like @octorelease/github:

{
  "plugins": [
    ["@octorelease/npm", {
      "npmPublish": false,
      "tarballDir": "dist"
    }],
    ["@octorelease/github", {
      "assets": "dist/*.tgz"
    }]
  ]
}