On github
editRegister on npm with 2FA
editWikimedia members are listed on https://www.npmjs.com/settings/wikimedia/members and 2FA is required for publishing. See wikitech:Npm registry for info on getting access.
Prepare the versioning and make a changelog
editCreate a new pull request which modifies the package.json version file number (see https://semver.org/) and run:
npm version patch --git-tag-version=false
… for trivial changes, or for bigger releases:
npm version minor --git-tag-version=false
… or if it contains breaking changes then:
npm version major --git-tag-version=false
Commit the modifications to package.json and package-lock.json
Generate change log if CHANGELOG.md exists
editA changelog (example) can be maintained by modifying CHANGELOG.md with the result of
git log `git describe --tags --abbrev=0` ..HEAD --oneline
Running tests
editAlways check tests are passing before releasing. If using Github pull requests with CI this should have been done automatically.
Create pull request
editCreate a pull request get someone to approve it, and merge.
Releasing the code
editOnce the code is merged
git fetch
git checkout origin/master
npm publish
you should be prompted for a 2FA token