workflow: adjust release script for non-pre-releases

This commit is contained in:
Evan You 2020-10-15 12:28:40 -04:00
parent 9664267793
commit 2ee2f945a6

View File

@ -7,7 +7,9 @@ const currentVersion = require('../package.json').version
const { prompt } = require('enquirer') const { prompt } = require('enquirer')
const execa = require('execa') const execa = require('execa')
const preId = args.preid || semver.prerelease(currentVersion)[0] || 'alpha' const preId =
args.preid ||
(semver.prerelease(currentVersion) && semver.prerelease(currentVersion)[0])
const isDryRun = args.dry const isDryRun = args.dry
const skipTests = args.skipTests const skipTests = args.skipTests
const skipBuild = args.skipBuild const skipBuild = args.skipBuild
@ -21,10 +23,7 @@ const versionIncrements = [
'patch', 'patch',
'minor', 'minor',
'major', 'major',
'prepatch', ...(preId ? ['prepatch', 'preminor', 'premajor', 'prerelease'] : [])
'preminor',
'premajor',
'prerelease'
] ]
const inc = i => semver.inc(currentVersion, i, preId) const inc = i => semver.inc(currentVersion, i, preId)