Download Windows arm64 node lib in CI

This commit is contained in:
Dennis Ameling 2020-11-13 17:27:00 +01:00
parent ed8f1e88be
commit 3172a87f58
2 changed files with 23 additions and 0 deletions

View file

@ -52,6 +52,10 @@ jobs:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
- name: Get NodeJS node-gyp lib for Windows arm64
if: ${{ matrix.os == 'windows-2019' && matrix.arch == 'arm64' }}
run: .\script\download-nodejs-win-arm64.ps1 ${{ matrix.node }}
- name: Install and build dependencies
run: yarn
env:

View file

@ -0,0 +1,19 @@
$nodeVersion = $args[0]
If ($null -eq $nodeVersion) {
Write-Error "No NodeJS version given as argument to this file. Run it like download-nodejs-win-arm64.ps1 12.10.1"
exit 1
}
$url = "https://unofficial-builds.nodejs.org/download/release/v$nodeVersion/win-arm64/node.lib"
$cacheFolder = "$env:LOCALAPPDATA\node-gyp\Cache\$nodeVersion\arm64"
If (!(Test-Path $cacheFolder)) {
New-Item -ItemType Directory -Force -Path $cacheFolder
}
$output = "$cacheFolder\node.lib"
$start_time = Get-Date
Invoke-WebRequest -Uri $url -OutFile $output
Write-Output "Downloaded arm64 NodeJS lib $nodeVersion in $((Get-Date).Subtract($start_time).Seconds) second(s)"