Parses CHANGELOG.md to publish a new release resource to the Github api
npm install release-to-github-with-changelog
Node v6.9.1 is required
CHANGELOG.md item is in sync with the last release on Github, with corresponding version tagpackage.json version is in sync with the master branch version tagCHANGELOG.md and package.json.CHANGELOG.md.CHANGELOG.md item should represent a release note of the version it describes:
v0.2.0 //version tag
The release title
// The release description in markdownv0.1.9
...
`
#### Full example:
`
v0.2.0
We can fly
Great news! The machine can now also fly!v0.1.0
We can move
$3
It can move, a bit slowly but still it moves.//...
`
$3
Either locally with export GITHUB_TOKEN=$yourToken or in your CI tool settings (see CircleCI example).$3
Don't forget the repository.url. It will be parsed to extract the repository full name (myOrg/myRepo in this example).
#### Test tool
You can include a check of your CHANGELOG.md format in your test command by using the provided release-to-github-with-changelog-pre-release-checks command.
`
{
"version": "0.2.0",
"respository": {
"type": "git",
"url": "git+https://github.com/myOrg/myRepo.git"
},
"files": ["dist"],
"scripts": {
"build": // build dist files
"release": "npm publish && npm run release-to-github-with-changelog",
"release": "npm publish && npm run release-to-github-with-changelog --branch=releases", // optional branch name
"test": "release-to-github-with-changelog-pre-release-checks && karma start"
}
}
`
CI example
circle.yml
`
machine:
node:
version: 4.1.0
dependencies:
pre:
- echo -e "$NPM_USER\n$NPM_PASS\n$NPM_EMAIL" | npm login
deployment:
production:
branch: master
commands:
- npm run release
``