-
Notifications
You must be signed in to change notification settings - Fork 267
/
release.js
39 lines (36 loc) · 999 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
32
33
34
35
36
37
38
39
const prompts = require('prompts')
const cp = require('child_process')
async function f () {
const response = await prompts({
type: 'select',
name: 'version',
message: `What's the release version?`,
choices: [
{ title: 'auto (by semver version)', value: 'auto' },
{ title: 'beta', value: 'beta' },
{ title: 'manual', value: 'manual' }
],
initial: 1
})
const { version } = response
const command = 'npm run build && lerna publish --exact --conventional-commits'
switch (version) {
case 'auto':
cp.execSync(command)
break
case 'beta':
cp.execSync(command + '--cd-version=prepatch --preid=beta --npm-tag=beta')
break
case 'manual':
const manual = await prompts({
type: 'text',
name: 'version',
message: `What's the EXACT version that you want to publish?`
})
cp.execFileSync(`${command} --repo-version ${manual.version}`)
break
default:
break
}
}
f()