Skip to content

Commit c4219ec

Browse files
committed
update release script
1 parent 2a8ce35 commit c4219ec

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.task/release.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ const main = async () => {
1010

1111
const state = {}
1212

13-
const q1option = new Set(['major', 'minor', 'patch', 'prerelease'])
13+
const q1option = new Set(['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease'])
1414

15-
state.release = await rl.question(`Release Type ${co.dim('(major, minor, patch, prerelease)')}:`)
16-
state.npmtag = state.release === 'prerelease' ? 'canary' : 'latest'
15+
state.release = await rl.question(`Release Type ${co.dim('(major, minor, patch, premajor, preminor, prepatch, prerelease)')}:`)
16+
state.npmtag = state.release.startsWith('pre') ? 'canary' : 'latest'
1717

1818
if (!q1option.has(state.release)) return
1919

20-
await cp.spawn('yarn', ['version', state.release], { stdio: 'pipe' })
20+
await cp.spawn('yarn', ['workspaces', 'foreach', '-A', '--no-private', 'version', state.release, '--immediate'], { stdio: 'pipe' })
2121

2222
const workspacepkgpaths = new Set
2323
const workspacetags = new Set
@@ -53,11 +53,9 @@ const main = async () => {
5353
}
5454

5555
await cp.spawn('git', ['commit', '-m', state.version])
56-
await cp.spawn('git', ['tag', state.version])
5756
await cp.spawn('git', ['push'])
58-
await cp.spawn('git', ['push', '--tags'])
5957

60-
await cp.spawn('yarn', ['workspaces', 'foreach', '--no-private', 'npm', 'publish', '--tag', state.npmtag])
58+
await cp.spawn('yarn', ['workspaces', 'foreach', '-A', '--no-private', 'npm', 'publish', '--tag', state.npmtag])
6159
}
6260

6361
main()

0 commit comments

Comments
 (0)