Deploy to npm

You can use Bitbucket Pipelines to build, test and publish your npm package.

You can use the feature of pushing back to your repository from within your pipeline to update the tag.

Be sure to include [skip ci] in the commit message of your version bump to avoid an infinite loop of builds.

Use the npm publish pipe to publish the package to the npm registry. To publish to a private npm package, edit your package.json to add a section like the example below.

package.json { "name": "package", "version": "1.0.11", "description": "Description", "publishConfig":{"registry":"my-internal-registry.local"} }

There are even more examples in the pipe repository of how to use the pipe with npm.

For this example, we need to add the $NPM_TOKEN variable in Bitbucket.

bitbucket-pipelines.yml image: node:10.15.1 pipelines: default: - step: name: Build and Test script: - npm install - npm test - step: name: Publish deployment: production script: - npm version minor -m "Upgrade to %s [skip ci]" - git push && git push --tags - pipe: atlassian/npm-publish:0.2.0 variables: NPM_TOKEN: $NPM_TOKEN

Still need help?

The Atlassian Community is here for you.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy