getCurrentVersion().then(({ latest, beta }) => { console.log(`Current Latest: ${latest}, Beta: ${beta}`) const { major, minor } = parse(latest) const [tag, currentBeta] = prerelease(beta) const newStable = `${major}.${minor + 1}.0` const newBeta = sameStableVersion(newStable, beta) ? currentBeta + 1 : 0 const newBetaVersion = `${newStable}-${tag}.${newBeta}` console.log(`New beta: ${newBetaVersion}`) console.log(`##vso[task.setvariable variable=PRE_RELEASE_VERSION;isOutput=true]${newBetaVersion}`) })
isPrerelease() { return Boolean(semver.prerelease(this.version)); }
process.exit(1); if (prerelease(newVersion)) { if (currentBranch !== 'development') { console.log(chalk.red('Alpha and beta releases are only allowed on development branch.'));
async dist(ctx) { const {dist, engines = {}} = await packageInfo('ghost', { version: ctx.version, agent: getProxyAgent() }); const skipNodeVersionCheck = (process.env.GHOST_NODE_VERSION_CHECK === 'false'); const isPrerelease = Boolean(prerelease(cliPackage.version)); if (!skipNodeVersionCheck && engines.node && !satisfies(process.versions.node, engines.node)) { throw new SystemError(`Ghost v${ctx.version} is not compatible with the current Node version.`); } if (engines.cli && !isPrerelease && !satisfies(cliPackage.version, engines.cli)) { throw new SystemError(`Ghost v${ctx.version} is not compatible with this version of the CLI.`); } ctx.shasum = dist.shasum; // eslint-disable-line require-atomic-updates ctx.tarball = dist.tarball; // eslint-disable-line require-atomic-updates }