Skip to content

Instantly share code, notes, and snippets.

@evancohen
Last active June 2, 2019 03:51
Show Gist options
  • Save evancohen/7744c18b7d93b7f5a1b1f64ceb99df20 to your computer and use it in GitHub Desktop.
Save evancohen/7744c18b7d93b7f5a1b1f64ceb99df20 to your computer and use it in GitHub Desktop.
An auto-publish script for node-pre-gyp that pre-builds and publishes binaries for node 4.0.0+
#!/bin/bash
NODE_VERSIONS=( "6" "7" "8" "9" "10" "11" "12")
function command_exists () { type "$1" &> /dev/null ;}
# Ensure that vnm is installed
if ! command_exists nvm; then
rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
source ~/.nvm/nvm.sh
fi
for i in "${NODE_VERSIONS[@]}"
do
:
# Install and use the correct version of node
nvm install $i
nvm use $i
# build, package and publish for the current package version
./node_modules/node-pre-gyp/bin/node-pre-gyp clean configure build package publish
done
@evancohen
Copy link
Author

Added node 7.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment