Skip to content

Commit d08f8e8

Browse files
committed
workflow(release): streamline the process
1 parent e08e585 commit d08f8e8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

scripts/release.mts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,18 @@ async function release() {
9292
}
9393
}
9494

95-
targetVersion = (await prompts({
96-
type: 'select',
97-
name: 'value',
98-
message: 'Select prerelease type',
99-
choices: Array.from(prereleaseTypes, title => ({
100-
title,
101-
value: semver.inc(currentVersion, t, title),
102-
})),
103-
})).value
95+
targetVersion = prereleaseTypes.length === 1
96+
// 已经是 rc 阶段就不用选了
97+
? semver.inc(currentVersion, t, prereleaseTypes[0])
98+
: (await prompts({
99+
type: 'select',
100+
name: 'value',
101+
message: 'Select prerelease type',
102+
choices: Array.from(prereleaseTypes, title => ({
103+
title,
104+
value: semver.inc(currentVersion, t, title),
105+
})),
106+
})).value
104107
} else if (t === 'custom') {
105108
targetVersion = (await prompts({
106109
type: 'text',

0 commit comments

Comments
 (0)