[minor] Use prebuildify (#105)

This commit is contained in:
Luigi Pinca
2018-07-03 08:12:30 +02:00
parent b0ff37cc6c
commit 1bdc3752a3
6 changed files with 36 additions and 6 deletions
-1
View File
@@ -1,4 +1,3 @@
prebuilds/
build/
appveyor.yml
test.js
+13
View File
@@ -7,3 +7,16 @@ node_js:
os:
- linux
- osx
before_deploy:
- ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$TRAVIS_OS_NAME-$(uname -m).tar"
- npm run prebuild
- tar --create --verbose --file="$ARCHIVE_NAME" --directory "$TRAVIS_BUILD_DIR/prebuilds" .
deploy:
provider: releases
api_key:
secure: OzQWRAFAR+oJ5uSFn2WwCun5RJDD5HQnPhXdJNj5ErpBy0CmiweF7YwnDhOywncw9Rz+iQEfg4MUCsnSkD0u5LRKmwvED/Y/ddol1VQTBmWREeQqCuGLr/DoD2nEnYoLIZWlIbqSEO3TtDaCuh818XqZhcfHms6jEMyF5WuKD/c=
file: "$ARCHIVE_NAME"
skip_cleanup: true
on:
tags: true
node: "10"
+16 -1
View File
@@ -1,3 +1,5 @@
build: off
configuration: Release
environment:
matrix:
- nodejs_version: "10"
@@ -15,4 +17,17 @@ test_script:
- node --version
- npm --version
- npm test
build: off
after_test:
- ps: If ($env:nodejs_version -eq "10") { npm run prebuild }
- ps: $env:ARTIFACT_NAME_PREFIX = if (Test-Path env:APPVEYOR_REPO_TAG_NAME) { $env:APPVEYOR_REPO_TAG_NAME } else { 'latest' }
artifacts:
- path: prebuilds
name: $(ARTIFACT_NAME_PREFIX)-win-$(PLATFORM)
deploy:
- provider: GitHub
artifact: /.*\.zip/
auth_token:
secure: CkWRNlzH+wmCa3+TRydWfvmSH7tevR81aAypEhXTR9ka5q0Ja8lAIPDwtPb+Ux9l
on:
appveyor_repo_tag: true
nodejs_version: "10"
+1 -1
View File
@@ -1,7 +1,7 @@
'use strict';
try {
module.exports = require('bindings')('bufferutil');
module.exports = require('node-gyp-build')(__dirname);
} catch (e) {
module.exports = require('./fallback');
}
+5 -2
View File
@@ -4,6 +4,8 @@
"description": "WebSocket buffer utils",
"main": "index.js",
"scripts": {
"install": "node-gyp-build",
"prebuild": "prebuildify --napi",
"test": "mocha"
},
"repository": {
@@ -20,9 +22,10 @@
},
"homepage": "https://github.com/websockets/bufferutil",
"dependencies": {
"bindings": "~1.3.0"
"node-gyp-build": "~3.4.0"
},
"devDependencies": {
"mocha": "~5.2.0"
"mocha": "~5.2.0",
"prebuildify": "~2.7.0"
}
}
+1 -1
View File
@@ -43,5 +43,5 @@ function use(bufferUtil) {
};
}
describe('bindings', use(require('bindings')('bufferutil')));
describe('bindings', use(require('node-gyp-build')(__dirname)));
describe('fallback', use(require('./fallback')));