[CI] Detect architecture when determining node download url (#91497)

Currently CI is setup to always download the x64 Node.js architecture.
When runing builds on ARM machines we'll want to make sure the
architecture matches the machine.
This commit is contained in:
Jonathan Budzenski 2021-02-16 13:21:16 -06:00 committed by GitHub
parent a99ccc27d7
commit db6cd8665c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,7 +56,13 @@ export WORKSPACE="${WORKSPACE:-$PARENT_DIR}"
nodeVersion="$(cat "$dir/.node-version")"
nodeDir="$cacheDir/node/$nodeVersion"
nodeBin="$nodeDir/bin"
classifier="x64.tar.gz"
hostArch="$(command uname -m)"
case "${hostArch}" in
x86_64 | amd64) nodeArch="x64" ;;
aarch64) nodeArch="arm64" ;;
*) nodeArch="${hostArch}" ;;
esac
classifier="$nodeArch.tar.gz"
UNAME=$(uname)
OS="linux"