-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrelease.js
31 lines (28 loc) · 822 Bytes
/
release.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const shell = require('shelljs')
const conventionalRecommendedBump = require('conventional-recommended-bump')
const { code } = shell.exec('npm whoami --registry=https://registry.npmjs.org/')
if (code) {
shell.exec('npm login --registry=https://registry.npmjs.org/')
}
conventionalRecommendedBump(
{
preset: `angular`
},
(error, recommendation) => {
if (error) {
process.exit(1)
}
shell
.exec('pnpm install')
.exec('pnpm run test')
.exec('npm version ' + recommendation.releaseType)
.exec(
`conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md && git commit -m "docs(CHANGELOG): ${
require('./package.json').version
}"`
)
.exec('npm publish')
.exec('git push')
.exec('git push --tags')
}
)