Successful build and publish in Travis and Appveyor with a commit tagged with “[publish binary]“.
Basically, if you want do something similar, take the /scripts/ folder from native-hdr-histogram , along with the Makefile, and copy and modify the appveyor.yml and .travis.yml files as you need. It looks scarier than it is, they’re already configured to handle node 4-6 for you. You might need to change the test target in the Makefile depending on your setup.
You also need to modify your package.json, and add a binary attribute . The module_path, remote_path, and package_name can be copied as is, but the host must be changed to match your S3 bucket URL. The module_name is the name of the compiled binary, I named it “histogram” for simplicity.
Additionally, using node-gyp requires you to create a binding.gyp file. When using node-pre-gyp, you must modify this file to include a “target” with the exact same content as this one , and you should modify your normal build target to use the module_name value used in your package.json, by setting its “target_name” to “<(module_name)”.
Your index.js, or rather, the main file that you export from your package.json should require the native file for exporting, using node-pre-gyp. It should end up similar to the one from here , assuming your binary section was similar to mine.
Now, when you want to publish a binary, all you need to do is add [publish binary] to your commit and push it to Github. It will take a while, because appveyor is kinda ever so slightly slow, but in the meantime if a user does download your native module without the published version available, they will simply build it themselves locally.