Skip to content

Commit

Permalink
build: make it easier on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Nov 2, 2024
1 parent 04a8a93 commit 0baf7a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
4 changes: 3 additions & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -104,6 +104,8 @@ if [[ "${SKIP_BUILD}" == "no" ]]; then
git add .
git reset -q --hard HEAD

rm -rf .build out*

cd ..
fi

Expand Down
28 changes: 10 additions & 18 deletions prepare_vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stable.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"tag": "1.95.0",
"commit": "912bb683695358a54ae0c670461738984cbb5b95"
"tag": "1.95.1",
"commit": "65edc4939843c90c34d61f4ce11704f09d3e5cb6"
}

0 comments on commit 0baf7a1

Please sign in to comment.