From cffa60b1e0cfed8bb77344a68cbbcb1865022f8d Mon Sep 17 00:00:00 2001 From: Georg Vienna Date: Fri, 28 Sep 2018 13:39:21 +0200 Subject: [PATCH] add appveyor --- README.md | 2 +- appveyor.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ binding.gyp | 2 ++ package.json | 3 ++- 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 appveyor.yml diff --git a/README.md b/README.md index da42b5c..42cd838 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ _This is a rewrite of [noble-uwp](https://github.com/jasongin/noble-uwp) using t ## System Requirements * Node.js v6.14.2 or later. * Windows 10 build 10.0.15063 or later - * Windows 10 SDK build 10.0.15063 + * Windows 10 SDK build 10.0.17134.0 ## Usage Simply require `noble-winrt` instead of `noble`: diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..fa5deb4 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,65 @@ +# vs 2017 image because Windows SDK 10.0.15063.0 is not available on vs 2015 image +image: Visual Studio 2017 + +cache: + - "%LOCALAPPDATA%\\Yarn" + +environment: + matrix: + # node + - RUNTIME: 'node' + RVERSION: '6.14.4' + - RUNTIME: 'node' + RVERSION: '8.12.0' + - RUNTIME: 'node' + RVERSION: '9.11.2' + - RUNTIME: 'node' + RVERSION: '10.10.0' + + # electron + - RUNTIME: 'electron' + RVERSION: '2.0.0' + DIST_URL: 'https://atom.io/download/atom-shell' + - RUNTIME: 'electron' + RVERSION: '3.0.0' + DIST_URL: 'https://atom.io/download/atom-shell' + + +install: + # install the right node version + - ps: $in_node_version = $env:RVERSION + - ps: if ($env:RUNTIME -match "electron") { $in_node_version="10.10.0"; } + - ps: echo "running node $in_node_version (was $env:RVERSION) on $env:platform" + - ps: Install-Product node $in_node_version $env:platform + - ps: | + npm install -g node-gyp node-pre-gyp-github npm-windows-upgrade 2>&1 | out-null + 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 + - cmd: npm uninstall -g node-pre-gyp-github + - cmd: yarn install --frozen-lockfile + - cmd: yarn test + - ps: $publish_binary = 0 + - ps: if ($env:appveyor_repo_tag -match "true") { $publish_binary=1; } + - ps: echo "tag $env:appveyor_repo_tag_name branch $env:APPVEYOR_REPO_BRANCH" +build_script: + - ps: echo "publish $publish_binary" + - ps: $arch = $env:platform + - ps: if ($arch -match "x86") { $arch="ia32"; } + - ps: | + if ($publish_binary -Eq "1") { + yarn global add node-pre-gyp node-pre-gyp-github@1.3.1 2>&1 | write-host + node-pre-gyp configure --runtime=$env:RUNTIME --target=$env:RVERSION --target_arch=$arch --dist-url=$env:DIST_URL 2>&1 | write-host + node-pre-gyp build --runtime=$env:RUNTIME --target=$env:RVERSION --target_arch=$arch --dist-url=$env:DIST_URL 2>&1 | write-host + node-pre-gyp package --runtime=$env:RUNTIME --target=$env:RVERSION --target_arch=$arch --dist-url=$env:DIST_URL 2>&1 | write-host + node-pre-gyp-github publish 2>&1 | write-host + if (-Not ($?)) { + throw "publishing failed"; + } + } + echo "done." +platform: + - x86 + - x64 diff --git a/binding.gyp b/binding.gyp index 0843b74..b12e964 100644 --- a/binding.gyp +++ b/binding.gyp @@ -13,6 +13,8 @@ 'AdditionalOptions': ['/await', '/std:c++latest'], }, }, + 'msvs_target_platform_version':'10.0.15063.0', + 'msvs_target_platform_minversion':'10.0.15063.0', 'conditions': [ ['OS=="win"', { 'defines': [ '_HAS_EXCEPTIONS=1' ] }] ], diff --git a/package.json b/package.json index 2d34f81..58e2528 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "install": "node-pre-gyp install --fallback-to-build", "test": "node --napi-modules ./test/ci_test.js", "test:bindings": "node --napi-modules ./test/test_binding.js", - "test:battery": "node --napi-modules ./test/test_battery.js" + "test:battery": "node --napi-modules ./test/test_battery.js", + "build:test": "node-pre-gyp install --fallback-to-build=false" }, "binary": { "module_name": "noble_winrt",