Skip to content

Commit

Permalink
add appveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
geovie committed Sep 28, 2018
1 parent 41e01a5 commit cffa60b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
65 changes: 65 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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 [email protected] 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
2 changes: 2 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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' ] }]
],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cffa60b

Please sign in to comment.