Skip to content

Commit e79108c

Browse files
committed
build: fix release script
1 parent 9d64538 commit e79108c

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

scripts/release.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const currentVersion = require('../package.json').version
88

99
const versionIncrements = ['patch', 'minor', 'major']
1010

11-
const tags = ['latest', 'next']
12-
1311
const inc = (i) => semver.inc(currentVersion, i)
1412
const bin = (name) => path.resolve(__dirname, `../node_modules/.bin/${name}`)
1513
const run = (bin, args, opts = {}) =>
@@ -43,19 +41,10 @@ async function main() {
4341
throw new Error(`Invalid target version: ${targetVersion}`)
4442
}
4543

46-
const { tag } = await prompt({
47-
type: 'select',
48-
name: 'tag',
49-
message: 'Select tag type',
50-
choices: tags
51-
})
52-
53-
console.log(tag)
54-
5544
const { yes: tagOk } = await prompt({
5645
type: 'confirm',
5746
name: 'yes',
58-
message: `Releasing v${targetVersion} with the "${tag}" tag. Confirm?`
47+
message: `Releasing v${targetVersion}. Confirm?`
5948
})
6049

6150
if (!tagOk) {
@@ -73,6 +62,7 @@ async function main() {
7362
// Generate the changelog.
7463
step('\nGenerating the changelog...')
7564
await run('yarn', ['changelog'])
65+
await run('yarn', ['prettier', '--write', 'CHANGELOG.md'])
7666

7767
const { yes: changelogOk } = await prompt({
7868
type: 'confirm',
@@ -84,17 +74,16 @@ async function main() {
8474
return
8575
}
8676

87-
// Commit changes to the Git.
77+
// Commit changes to the Git and create a tag.
8878
step('\nCommitting changes...')
89-
await run('git', ['add', '-A'])
79+
await run('git', ['add', 'CHANGELOG.md', 'package.json'])
9080
await run('git', ['commit', '-m', `release: v${targetVersion}`])
81+
await run('git', ['tag', `v${targetVersion}`])
9182

9283
// Publish the package.
9384
step('\nPublishing the package...')
9485
await run('yarn', [
9586
'publish',
96-
'--tag',
97-
tag,
9887
'--new-version',
9988
targetVersion,
10089
'--no-commit-hooks',
@@ -103,7 +92,6 @@ async function main() {
10392

10493
// Push to GitHub.
10594
step('\nPushing to GitHub...')
106-
await run('git', ['tag', `v${targetVersion}`])
10795
await run('git', ['push', 'origin', `refs/tags/v${targetVersion}`])
10896
await run('git', ['push'])
10997
}

0 commit comments

Comments
 (0)