A guide to publishing a package to NPM using Travis.
This is a Work in Progress - modifying the pypi docs for NPM
Step-by-step guide
- If you're not familiar with how to package a JS module and and share it on NPM, get your bearings by reading their docs.
- Modify your repo's Travis configuration so that tagging a release results in a publish to npmjs.
Contact DevOps to get publish tokens for the edX NPMJS account. Use the Travis CI command line client to encrypt the token:
travis encrypt --add deploy.api_key NPMTOKEN
- There are two options here, using the Stages feature of Travis (studio-frontend) or using Travis' simple built-in deploy
- Travis documentation on NPM deployment
- To publish a new version of your package, update the version, then push a corresponding tag to GitHub.
- You're done! Don't forget to update webpack files so they download the new package from NPM.
Find your package at https://pypi.python.org/pypi/[package-name]/[version]
Troubleshooting
If your tag is in GitHub, but is not starting a build in Travis, or if you are deploying from too many sub-builds in Travis, see the following changes to .travis.yml.
Related articles