Patch version control tag version to package.json when deploy to npm on CI.
npm install patch-versionPatch git tag version to package.json before publish to npm.
1. Install patch-version from npm.
2. Stick your package.json to one version. My suggestion is 0.0.1, as this package does.
3. Add patch-version command to deployment hook in your CI configuration file.
4. When you want to publish a new version to npm, create a tag with a valid semver, push it to trigger CI build and deployment. The tag version will be patched to package.json before publish to npm.
- Travis
- GitLab
- AppVeyor
Here is the example configuration in .travis.yml for Travis CI:
``yaml
before_deploy:
- ./node_modules/.bin/patch-version
deploy:
provider: npm
email: "my@email"
api_key:
secure: "secure-key"
``
MIT License.