-
Notifications
You must be signed in to change notification settings - Fork 45
/
appveyor.yml
60 lines (56 loc) · 2.42 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# vs 2017 image because Windows SDK 10.0.15063.0 is not available on vs 2015 image
image: Visual Studio 2017
environment:
GYP_MSVS_VERSION: 2015
matrix:
- node_version: '6'
- node_version: '8'
- node_version: '10'
install:
# install the right node version
- ps: Install-Product node $env:node_version $env:platform
- ps: echo "running node $env:node_version on $env:platform"
- ps: |
cmd /c "npm install -g node-gyp node-pre-gyp-github npm-windows-upgrade 2>&1"
if ($LASTEXITCODE -NE 0) { throw "Failed installing node-gyp node-pre-gyp-github npm-windows-upgrade"; }
# update npm and node-gyp, some configurations wont build without an up to date node-gyp
- ps: npm-windows-upgrade --npm-version latest
- ps: npm -v
- ps: node-gyp -v
- ps: $publish_binary = 0
- ps: if ($env:appveyor_repo_tag -match "true" -and $env:appveyor_repo_tag_name -match '^v?[0-9]') { $publish_binary=1; }
- ps: echo "tag $env:appveyor_repo_tag_name branch $env:APPVEYOR_REPO_BRANCH"
- ps: |
# https://github.com/mapbox/node-pre-gyp/issues/209#issuecomment-217690537
if (($env:platform -ieq "x86") -and ($env:node_version -match "^4")) {
echo "Configuring NPM cafile to make Node 4 x86 builds work."
npm config set -g cafile=package.json
npm config set -g strict-ssl=false
}
build_script:
- ps: echo "publish $publish_binary"
- ps: |
$ErrorActionPreference = 'Continue'
$uwp_modules = @("windows.foundation", "windows.devices.bluetooth", "windows.devices.bluetooth.advertisement", "windows.devices.bluetooth.genericattributeprofile", "windows.devices.enumeration", "windows.devices.radios", "windows.storage.streams")
foreach ($module in $uwp_modules) {
$path = "./uwp/" + $module
cd $path
echo "============================== start building $module =============================="
Convert-Path .
node-gyp -v
npm install --build-from-source 2>&1 | write-host
if ($LASTEXITCODE -NE 0) { throw "Failed building $module"; }
./node_modules/.bin/node-pre-gyp package 2>&1 | write-host
if ($LASTEXITCODE -NE 0) { throw "Failed packaging $module"; }
if ($publish_binary -Eq "1") {
node-pre-gyp-github publish --release 2>&1 | write-host
if (-Not ($?)) {
throw "publishing failed";
}
}
cd ../..
}
echo "done."
platform:
- x86
- x64