Skip to content

Commit

Permalink
ci(package): add scripts 'release:note'
Browse files Browse the repository at this point in the history
re #44
  • Loading branch information
xingorg1 committed Dec 3, 2020
1 parent 824dd75 commit 3861cdf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/bin/gen-release-note.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const version = process.argv[2] || process.env.VERSION
const cc = require('conventional-changelog')
const file = `./RELEASE_NOTE${version ? `_${version}` : ``}.md`
const fileStream = require('fs').createWriteStream(file)

cc({
preset: 'angular',
pkg: {
transform(pkg) {
pkg.version = `v${version}`
return pkg
}
}
})
.pipe(fileStream)
.on('close', () => {
console.log(`Generated release note at ${file}`)
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"pub": "sh build/git-release.sh && sh build/release.sh",
"release:note": "node scripts/gen-release-note.js",
"commit": "git add . && git-cz && git push"
},
"repository": {
Expand Down

0 comments on commit 3861cdf

Please sign in to comment.