浏览代码

build: make it easier on windows

Baptiste Augrain 7 月之前
父节点
当前提交
0baf7a131d
共有 3 个文件被更改,包括 15 次插入21 次删除
  1. 3 1
      build/build.sh
  2. 10 18
      prepare_vscode.sh
  3. 2 2
      stable.json

+ 3 - 1
build/build.sh

@@ -86,7 +86,7 @@ if [[ "${SKIP_SOURCE}" == "no" ]]; then
   echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\"" >> build.env
 else
   if [[ "${SKIP_ASSETS}" != "no" ]]; then
-    rm -rf VSCode*
+    rm -rf vscode-* VSCode-*
   fi
 
   . build.env
@@ -104,6 +104,8 @@ if [[ "${SKIP_BUILD}" == "no" ]]; then
     git add .
     git reset -q --hard HEAD
 
+    rm -rf .build out*
+
     cd ..
   fi
 

+ 10 - 18
prepare_vscode.sh

@@ -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

+ 2 - 2
stable.json

@@ -1,4 +1,4 @@
 {
-  "tag": "1.95.0",
-  "commit": "912bb683695358a54ae0c670461738984cbb5b95"
+  "tag": "1.95.1",
+  "commit": "65edc4939843c90c34d61f4ce11704f09d3e5cb6"
 }