1.5.0 • Published 7 years ago
dh2o-release v1.5.0
dh2o-release
Release script for DH2O projects
This package exports a function that will run the release script when invoked. It takes an object with two parameters, both optional (buildStep
and publishStep
).
To use it, create a release.js
file in your project that looks something like this:
require('dh2o-release')({
buildStep: () => {} // returns a Promise
publishStep: () => {} // returns a Promise
})
then run node release.js -t [major|minor|patch]
What it does:
- Checks that you're on develop and have no uncommitted changes.
- Pulls both develop and master.
- Runs your
buildStep
, if you have one -- the function should return a promise that resolves when your build is complete. - Increments your package.json version according to semver (depending on whether you specified a major, minor, or patch release).
- Commits the new package.json and build result to develop.
- Merges develop to master, pushes master, and creates a new tag.
- Runs your
publishStep
, if you have one. Same deal asbuildStep
.
An easy way to write the build/publish step functions is to use the node-cmd-promise
library, which takes a bash command and returns a promise that resolves when the command is finished. See this repo's own release.js
for an example.
1.5.0
7 years ago