allow same version when building npm package on Circle (#5601)

* allow same version when building npm package on Circle

* check next dev version from node script

* print current package version for complete info
This commit is contained in:
Gleb Bahmutov
2019-11-06 12:51:58 -05:00
committed by Jennifer Shehane
parent a57dfa6927
commit 8e309e9bca
4 changed files with 19 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ install:
- node --version
- node --print process.arch
- npm --version
- npm run check-next-dev-version
# prints all public variables relevant to the build
- print-env Platform
- npm run check-node-version

View File

@@ -714,9 +714,10 @@ jobs:
steps:
- attach_workspace:
at: ~/
- run: npm run check-next-dev-version
- run:
name: bump NPM version
command: npm --no-git-tag-version version ${NEXT_DEV_VERSION:-0.0.0-development}
command: npm --no-git-tag-version --allow-same-version version ${NEXT_DEV_VERSION:-0.0.0-development}
- run:
name: build NPM package
working_directory: cli
@@ -1121,7 +1122,7 @@ mac-workflow: &mac-workflow
branches:
only:
- develop
- lint:
name: Mac lint
executor: mac

View File

@@ -17,6 +17,7 @@
"bump": "node ./scripts/binary.js bump",
"check-deps": "node ./scripts/check-deps.js --verbose",
"check-deps-pre": "node ./scripts/check-deps.js --verbose --prescript",
"check-next-dev-version": "node scripts/check-next-dev-version.js",
"check-node-version": "node scripts/check-node-version.js",
"check-terminal": "node scripts/check-terminal.js",
"clean-deps": "npm run all clean-deps && rm -rf node_modules",

View File

@@ -0,0 +1,14 @@
/* eslint-disable no-console */
if (!process.env.NEXT_DEV_VERSION) {
console.log('NEXT_DEV_VERSION is not set')
process.exit(0)
}
const currentVersion = require('../package.json').version
if (currentVersion === process.env.NEXT_DEV_VERSION) {
console.warn('⚠️ NEXT_DEV_VERSION is set to the same value as current package.json version "%s"', currentVersion)
process.exit(0)
}
console.log('NEXT_DEV_VERSION is different from the current package version "%s"', currentVersion)