Commit 8d22c41d by Dane Springmeyer

[publish binary]

parent aa5998f3
...@@ -9,6 +9,10 @@ env: ...@@ -9,6 +9,10 @@ env:
- secure: HxCS2dQAWI0KmCFnFNNZoucG4FeAW+itG7+Hp0dNtwmxZzGOZYFO2bZcGvTAMNfVN++oqLxTebYQI1oB5yUl5mPJjrjthaGS6Zq3S6rfJcXiv+icYgEXlR6ejQ97dsHw1Jeg8nedCQlI4kHfvG6pgBLhq9hnugxH1Cjhdt14E9U= - secure: HxCS2dQAWI0KmCFnFNNZoucG4FeAW+itG7+Hp0dNtwmxZzGOZYFO2bZcGvTAMNfVN++oqLxTebYQI1oB5yUl5mPJjrjthaGS6Zq3S6rfJcXiv+icYgEXlR6ejQ97dsHw1Jeg8nedCQlI4kHfvG6pgBLhq9hnugxH1Cjhdt14E9U=
before_install: before_install:
# check if tag exists and matches package.json
- scripts/validate_tag.sh
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put node-pre-gyp on path # put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH - export PATH=./node_modules/.bin/:$PATH
- echo $NODE_VERSION - echo $NODE_VERSION
...@@ -35,7 +39,7 @@ before_script: ...@@ -35,7 +39,7 @@ before_script:
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi; - if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi - if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi
# for testing node-webkit, launch a virtual display # for testing node-webkit, launch a virtual display
- if [ "$NODE_WEBKIT" != "" ]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; fi - if [ "$NODE_WEBKIT" != "" ]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start +extension RANDR; fi
# note: `sleep 3` gives xvfb some time to start # note: `sleep 3` gives xvfb some time to start
script: script:
......
File mode changed from 100644 to 100755
#!/bin/bash
set -u
# let's catch the case where we tag but
# forget to increment the package.json version
# check if we are on a tag
if [ `git describe --tags --always HEAD` ]; then
echo 'looks like we are on a tag'
if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then
echo 'git reports the same tag as travis'
# now check to make sure package.json `version` matches
MODULE_VERSION=$(node -e "console.log(require('./package.json').version)")
if [[ $MODULE_VERSION != $TRAVIS_BRANCH ]] && [[ v$MODULE_VERSION != $TRAVIS_BRANCH ]]; then
echo "package.json version ($MODULE_VERSION) does not match tag ($TRAVIS_BRANCH)"
exit 1
else
echo "Validation success: package.json ($MODULE_VERSION) matches tag ($TRAVIS_BRANCH)"
fi
else
echo "warning: travis thinks the tag ($TRAVIS_BRANCH) differs from git (`git describe --tags --always HEAD`)"
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment