mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-23 04:58:56 -05:00
workflow: allow release to local registry for testing purpose
This commit is contained in:
+14
-1
@@ -36,9 +36,18 @@ process.env.VUE_CLI_RELEASE = true
|
||||
const execa = require('execa')
|
||||
const semver = require('semver')
|
||||
const inquirer = require('inquirer')
|
||||
const minimist = require('minimist')
|
||||
const { syncDeps } = require('./syncDeps')
|
||||
// const { buildEditorConfig } = require('./buildEditorConfig')
|
||||
|
||||
const cliOptions = minimist(process.argv)
|
||||
if (cliOptions['local-registry']) {
|
||||
inquirer.prompt = () => ({
|
||||
bump: 'minor',
|
||||
yes: true
|
||||
})
|
||||
}
|
||||
|
||||
const curVersion = require('../lerna.json').version
|
||||
|
||||
const release = async () => {
|
||||
@@ -96,7 +105,7 @@ const release = async () => {
|
||||
const releaseType = semver.diff(curVersion, version)
|
||||
|
||||
let distTag = 'latest'
|
||||
if (releaseType.startsWith('pre')) {
|
||||
if (releaseType.startsWith('pre') && !cliOptions['local-registry']) {
|
||||
distTag = 'next'
|
||||
}
|
||||
|
||||
@@ -111,6 +120,10 @@ const release = async () => {
|
||||
lernaArgs.push('--force-publish')
|
||||
}
|
||||
|
||||
if (cliOptions['local-registry']) {
|
||||
lernaArgs.push('--no-git-tag-version', '--no-commit-hooks', '--no-push', '--yes')
|
||||
}
|
||||
|
||||
await execa(require.resolve('lerna/cli'), lernaArgs, { stdio: 'inherit' })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user