mirror of
https://github.com/drone-plugins/drone-npm.git
synced 2026-06-04 18:23:52 +08:00
1.2 KiB
1.2 KiB
Use the NPM plugin to publish a library to a NPM registry.
The following parameters are used to configuration the publishing:
- username - the username for the account to publish with.
- password - the password for the account to publish with.
- email - the email address associated with the account to publish with.
- registry - the registry URL to use (https://registry.npmjs.org by default)
- folder - the folder, relative to the workspace, containing the library (uses the workspace directory, by default)
- always_auth - forces npm to require authentication when accessing the registry (false by default)
The following is a sample NPM configuration in your .drone.yml file which can publish to the global npm registry:
publish:
npm:
username: $$NPM_USERNAME
password: $$NPM_PASSWORD
email: $$NPM_EMAIL
For a private npm registry, such as Sinopia the following config can be used:
publish:
npm:
username: $$NPM_USERNAME
password: $$NPM_PASSWORD
email: $$NPM_EMAIL
registry: "http://myregistry:4873"
always_auth: true