Skip to content

Commit

Permalink
Update actions-artifacts.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvanrijn committed Oct 30, 2024
1 parent ff39dda commit 22c568f
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions docs/tools/actions-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,30 @@ sed -i '/"peerDependencies": {/,/}/d' -- 'package.json'
sed -i -z 's| "bundleDependencies": \[\n ".*"\n \]| "bundleDependencies": \[\]|' -- 'package.json'
# Install
if [[ "$OSTYPE" == "msys" ]]; then
bin/windows/x64/node/node-v$node_version-win-x64/node.exe bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js install --no-offline "electron@$electron_version"
"bin/windows/x64/node/node-v$node_version-win-x64/node.exe" "bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js" install --no-offline "electron@$electron_version"
else
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js install --no-offline "electron@$electron_version"
cat "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node.*" > "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
"bin/linux/x64/node/node-v$node_version-linux-x64/bin/node" "bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js" install --no-offline "electron@$electron_version"
rm "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
fi
rm -rf .npm/
# Dedupe
if [[ "$OSTYPE" == "msys" ]]; then
bin/windows/x64/node/node-v$node_version-win-x64/node.exe bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js dedupe
"bin/windows/x64/node/node-v$node_version-win-x64/node.exe" "bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js" dedupe
else
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js dedupe
cat "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node.*" > "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
"bin/linux/x64/node/node-v$node_version-linux-x64/bin/node" "bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js" dedupe
rm "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
fi
rm -rf .npm/
export npm_config_target=$(cat node_modules/electron/package.json | python -c "import sys, json; print(json.load(sys.stdin)['version'])")
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node node_modules/electron/install.js
if [[ "$OSTYPE" == "msys" ]]; then
"bin/windows/x64/node/node-v$node_version-win-x64/node.exe" "bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js" "node_modules/electron/install.js"
else
cat "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node.*" > "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
"bin/linux/x64/node/node-v$node_version-linux-x64/bin/node" "bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js" "node_modules/electron/install.js"
rm "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
fi
mkdir -p "bin/linux/x64/electron/electron-v$npm_config_target-linux-x64"
mv -T node_modules/electron/dist "bin/linux/x64/electron/electron-v$npm_config_target-linux-x64"
rm -r node_modules/
Expand Down Expand Up @@ -183,19 +193,29 @@ sed -i '/"peerDependencies": {/,/}/d' -- 'package.json'
sed -i -z 's| "bundleDependencies": \[\n ".*"\n \]| "bundleDependencies": \[\]|' -- 'package.json'
# Install
if [[ "$OSTYPE" == "msys" ]]; then
bin/windows/x64/node/node-v$node_version-win-x64/node.exe bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js install --no-offline "electron@$electron_version"
"bin/windows/x64/node/node-v$node_version-win-x64/node.exe" "bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js" install --no-offline "electron@$electron_version"
else
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js install --no-offline "electron@$electron_version"
cat "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node.*" > "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
"bin/linux/x64/node/node-v$node_version-linux-x64/bin/node" "bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js" install --no-offline "electron@$electron_version"
rm "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
fi
rm -rf .npm/
# Dedupe
if [[ "$OSTYPE" == "msys" ]]; then
bin/windows/x64/node/node-v$node_version-win-x64/node.exe bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js dedupe
"bin/windows/x64/node/node-v$node_version-win-x64/node.exe" "bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js" dedupe
else
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js dedupe
cat "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node.*" > "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
"bin/linux/x64/node/node-v$node_version-linux-x64/bin/node" "bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js" dedupe
rm "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
fi
rm -rf .npm/
bin/linux/x64/node/node-v$node_version-linux-x64/bin/node node_modules/electron/install.js
if [[ "$OSTYPE" == "msys" ]]; then
"bin/windows/x64/node/node-v$node_version-win-x64/node.exe" "bin/windows/x64/node/node-v$node_version-win-x64/node_modules/npm/bin/npm-cli.js" "node_modules/electron/install.js"
else
cat "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node.*" > "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
"bin/linux/x64/node/node-v$node_version-linux-x64/bin/node" "bin/linux/x64/node/node-v$node_version-linux-x64/lib/node_modules/npm/bin/npm-cli.js" "node_modules/electron/install.js"
rm "bin/linux/x64/node/node-v$node_version-linux-x64/bin/node"
fi
mkdir -p "bin/windows/x64/electron/electron-v$npm_config_target-win32-x64"
mv -T node_modules/electron/dist "bin/windows/x64/electron/electron-v$npm_config_target-win32-x64"
rm -r node_modules/
Expand Down

0 comments on commit 22c568f

Please sign in to comment.