build: use semantic commits to get next version (#14851)

This commit is contained in:
Zach Bloomquist
2021-02-04 18:30:27 +00:00
committed by GitHub
parent aef9facd19
commit 0abb5efe90
12 changed files with 193 additions and 166 deletions

View File

@@ -3,7 +3,6 @@ let fs = require('fs-extra')
let glob = require('glob')
const Promise = require('bluebird')
const inquirer = require('inquirer')
const path = require('path')
glob = Promise.promisify(glob)
@@ -85,32 +84,6 @@ const getReleases = (releases) => {
}]
}
const getNextVersion = function ({ version } = {}) {
if (!version) {
({
version,
} = require(path.join(__dirname, '..', '..', 'package.json')))
}
const message = `Bump next version to...? (currently: ${version})`
const defaultVersion = function () {
const a = version.split('.')
let v = a[a.length - 1]
v = Number(v) + 1
a.splice(a.length - 1, 1, v)
return a.join('.')
}
return [{
name: 'nextVersion',
type: 'input',
message,
default: defaultVersion,
}]
}
const getVersions = (releases) => {
return [{
name: 'version',
@@ -213,11 +186,6 @@ const whichBumpTask = () => {
.get('task')
}
const nextVersion = (version) => {
return prompt(getNextVersion(version))
.get('nextVersion')
}
const toCommit = ({ version }) => {
return prompt(getCommitVersion(version))
.get('commit')
@@ -232,11 +200,9 @@ module.exports = {
getVersions,
getBumpTasks,
deployNewVersion,
nextVersion,
whichZipFile,
whichVersion,
whichRelease,
whichPlatform,
whichBumpTask,
}