mirror of
https://github.com/cypress-io/cypress.git
synced 2026-03-07 15:29:16 -06:00
build: use semantic commits to get next version (#14851)
This commit is contained in:
@@ -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,
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user