|
@@ -78,29 +78,21 @@ if [[ "${OS_NAME}" == "linux" ]]; then
|
|
|
export npm_config_arm_version=7
|
|
|
fi
|
|
|
elif [[ "${OS_NAME}" == "windows" ]]; then
|
|
|
- # TODO: Should be replaced with upstream URL once https://github.com/nodejs/node-gyp/pull/2825
|
|
|
- # gets merged.
|
|
|
- rm -rf .build/node-gyp
|
|
|
- mkdir -p .build/node-gyp
|
|
|
- cd .build/node-gyp
|
|
|
-
|
|
|
- git config --global user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
|
|
|
- git config --global user.name "${GITHUB_USERNAME} CI"
|
|
|
- git clone https://github.com/nodejs/node-gyp.git .
|
|
|
- git checkout v10.0.1
|
|
|
- npm install
|
|
|
-
|
|
|
- npm_config_node_gyp="$( pwd )/bin/node-gyp.js"
|
|
|
- export npm_config_node_gyp
|
|
|
-
|
|
|
- cd ../..
|
|
|
-
|
|
|
if [[ "${npm_config_arch}" == "arm" ]]; then
|
|
|
export npm_config_arm_version=7
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
-npm ci
|
|
|
+for i in {1..5}; do # try 5 times
|
|
|
+ npm ci && break
|
|
|
+ if [[ $i == 3 ]]; then
|
|
|
+ echo "Npm install failed too many times" >&2
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+ echo "Npm install failed $i, trying again..."
|
|
|
+
|
|
|
+ sleep $(( 15 * (i + 1)))
|
|
|
+done
|
|
|
|
|
|
setpath() {
|
|
|
local jsonTmp
|