Last active
June 2, 2019 03:51
-
-
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+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added node 7.0.0