mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: check node and npm version in release workflow (#1454)
* chore: check npm and node version in learn publish * update error * distinguished between node and npm
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -125,6 +125,7 @@
|
||||
"react-loadable": "^5.5.0",
|
||||
"react-test-renderer": "^16.13.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"ts-jest": "^26.4.2",
|
||||
"ts-loader": "^8.0.7",
|
||||
"typescript": "^4.1.2",
|
||||
|
||||
@@ -19,7 +19,27 @@ rootDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
|
||||
|
||||
lernaVersionArg="$1"
|
||||
if [[ -z $lernaVersionArg ]]; then
|
||||
echo 'Please provide argument for "lerna version".'
|
||||
echo '[ERROR] Please provide argument for "lerna version".'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
currentNpm=$(npm --version)
|
||||
npmVersion=$(node -e "process.stdout.write(require('./package.json').engines.npm)");
|
||||
isSatisfiedNpm=$(node -e "process.stdout.write(require('semver').satisfies('$currentNpm', '$npmVersion').toString())");
|
||||
|
||||
currentNode=$(node --version)
|
||||
nodeVersion=$(node -e "process.stdout.write(require('./package.json').engines.node)");
|
||||
isSatisfiedNode=$(node -e "process.stdout.write(require('semver').satisfies('$currentNode', '$nodeVersion').toString())");
|
||||
|
||||
# Check node version compatible with package.json
|
||||
if [[ $isSatisfiedNode != 'true' ]]; then
|
||||
echo "[ERROR] Your node version($currentNode) is not compatible with package.json($nodeVersion)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check npm version compatible with package.json
|
||||
if [[ $isSatisfiedNpm != 'true' ]]; then
|
||||
echo "[ERROR] Your npm version($currentNpm) is not compatible with package.json($npmVersion)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -27,7 +47,7 @@ fi
|
||||
lerna version $1 --no-push --no-git-tag-version --yes
|
||||
|
||||
if [[ -z $(git diff --stat) ]]; then
|
||||
echo 'No changed packages to version.'
|
||||
echo '[ERROR] No changed packages to version.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -40,7 +60,7 @@ rm "$rootDir/package-lock.json"
|
||||
npm i --package-lock-only
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo 'Can not update package-lock.json'
|
||||
echo '[ERROR] Can not update package-lock.json'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user