forked from node-webrtc/node-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
65 lines (57 loc) · 2.49 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
os:
- linux
- osx
language: node_js
node_js:
- "0.10"
- "0.11"
- "0.12"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y python libnss3-dev libncurses5-dev libssl-dev libexpat-dev
- npm install -g grunt-cli
- npm install node-gyp -g
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put local node-pre-gyp on PATH
- export PATH=./node_modules/.bin/:$PATH
# install aws-sdk so it is available for publishing
- npm install aws-sdk
# figure out if we should publish
- PUBLISH_BINARY=false
# if we are building a tag then publish
- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi;
# or if we put [publish binary] in the commit message
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi;
- platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
# If version is 0.9 do not publish to avoid duplicated binary error, caused by 0.9 and 0.10
# returning same v number in node.js.
- if [[ "$TRAVIS_NODE_VERSION" == '0.9' ]]; then PUBLISH_BINARY=false; fi;
install:
- npm install --build-from-source
#- node-pre-gyp package publish
- npm test
before_script:
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY
# if publishing, do it
- if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package publish; fi;
# cleanup
- node-pre-gyp clean
- node-gyp clean
script:
# if publishing, test installing from remote
- INSTALL_RESULT=0
- if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi;
# if install returned non zero (errored) then we first unpublish and then call false so travis will bail at this line
- if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish;false; fi
# If success then we arrive here so lets clean up
- node-pre-gyp clean
after_success:
# if success then query and display all published binaries
- node-pre-gyp info
notifications:
email: false
env:
global:
- secure: "fu0XuIPY4LOzDlbz8f4tAdrqTxkFRzdlknHtbI2Cs3zSqafx8WKSfCIh/yRVjGVXLR+9Qk1MOsLhCkuzfE3iTcYmSE0mA+cmVoDXrb8sYdi3LWjm+SKsAj9Sm3mZY56Mg9gijy4xjuu16LcFxJIZSyr5kjT+UCrZ2Rg38vezbmQ="
- secure: "gYv1HEWTR0p/cyoRd7qF/7TZsTWZ9walACVPxs4t/ZNluZyqcEsLNpH8hJMJ7wUmcYymqNpe9irZcvcXvsrh6YBjZnLYNIz7/iyIUBTSUA1l1NzTP7IsR6Rnt7H3YROk89xvF408n6GcrTrY8KoRtDlAq8Zp04oFsvf+/E6SCLs="