First, make sure version is bumped to new version. (if code change)
Then, on each of MacOSX, Windows, Linux, do:
git clone https://github.com/node-hid/node-hid.git
cd node-hid
npm run prepublish # get the hidapi submodule
npm install --build-from-source # rebuilds the C code
node ./src/show-devices.js # simple tests
npm run prebuild # build all the versions
npm run prebuild-upload <gh-token> # upload all the versions using github token
And then on master dev box:
npm run clean # clean out directory
npm publish # update npmjs, be sure to have Authy app for OTP code
remember for Windows
$env:PYTHON = "$env:USERPROFILE\.windows-build-tools\python27\python.exe"
package.jsonREADME.md to reference this current version (if needed)git tag v0.5.4 -a and include the change log in the tag's annotation.git push --tagsnpm publish.Before we are able to run everything stated above some steps need to be taken. Specifically for being able to publish the pre compiled binaries to Github. The correct keys need to be setup in the travis.yml and appveyor.yml files. For Travis, this needs to be done by the admin of the Github repo. For AppVeyor, this will need to be done by the owner of the AppVeyor account.
Setting up the keys in Travis is easy if you have Ruby and Rubygems installed and working then run:
gem install travis
After the Travis gem is installed run the following command for each of the required keys:
travis encrypt SOMEVAR=secretvalue
And substitute the values in the .travis.yml file for the new ones. Detailed instructions can
be found here: http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
It is even easier than Travis to configure AppVeyor. You do not need to install anything, just go to your account and click on encrypt tool. Enter the values in the input field and click "Encrypt". In the same way as we do for Travis, we then need to substitute the newly generated values for the old ones.
Detailed instructions can be found here: http://www.appveyor.com/docs/build-configuration#secure-variables
node-pre-gyp-github
npm install -g node-pre-gyp
npm install -g node-pre-gyp-github
npm install -g rimraf
Checkout clean node-hid:
rm -rf node-hid
git clone https://github.com/node-hid/node-hid.git
cd node-hid
npm run prepublish
Clean checkout before each build:
npm run clean
npm install
Do simple sanity tests
node ./src/show-devices.js
node ./src/test-blink1.js
Test out node-pre-gyp packaging and publish draft:
node-pre-gyp configure
node-pre-gyp build
node-pre-gyp package
node-pre-gyp-github publish
Do the above for each version of node:
Using nvm-windows, install each version of node needed (32-bit & 64-bit):
nvm install v0.12.7 32
nvm install v0.12.7 64
nvm install v4.6.2 32
nvm install v4.6.2 64
nvm install v6.9.1 32
nvm install v6.9.1 64
Then, before each build: ``` nvm use v0.12.7 32 node install -g node-pre-gyp node install -g node-pre-gyp-github node install -g rimraf npm run clean npm install
```
(cribbed from node-serialport)
package.json, commit and push.git tag 4.0.0 -a and include the change log in the tag's annotation.git push --tagsrm -rf node_modules build && npm installnpm publish.Differences for beta release
git tag 4.0.1-beta1 -a and include the change log in the tag's annotation.npm publish --tag betagit pullnpm installnpm run gyppackagenpm run gyppublishnpm run clean