UNPKG

2.84 kBYAMLView Raw
1language: objective-c
2
3env:
4 global:
5 - secure: "gve1nkeKkwFEG1VAT3i+JwYyAdF0gKXwKx0uxbkBTsmm2M+0MDusohQdFLoEIkSIFktXBIDefoa7iGpLKRfG2VsZLpwJgnvnD0HqbnuR+k+W+bu7BHt4CAaR6GTllsDCjyq9zNyhUThzSnf2WNIpOEF5kHspZlbGfawURuUJH/U="
6 - secure: "jqVpmWxxBVXu2X8+XJMpKH0cooc2EKz9xKL2znBfYdNafJORSXcFAVbjCX5mZmVDcgIMwDtm2+gIG4P73hzJ2e3S+y2Z9ROJGyXHa3AxUTvXHQsxqzH8coHHqB8vTvfr0t2O5aKfpvpICpSea39r0hzNoMv6Ie5SwBdqj1YY9K0="
7 matrix:
8 - NODE_VERSION="v8"
9 - NODE_VERSION="v7"
10 - NODE_VERSION="v6"
11 - NODE_VERSION="v5"
12 - NODE_VERSION="v4"
13 - NODE_VERSION="v0.12"
14 - NODE_VERSION="v0.10"
15
16before_install:
17
18 - echo $TRAVIS_OS_NAME
19
20 # commit
21 # ------------------------
22 # The commit message is used to determine the whether to manually
23 # invoke a binary publish
24
25 - COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
26
27 # node
28 # ------------------------
29
30 - export PATH=./node_modules/.bin/:$PATH
31 - rm -rf ~/.nvm && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
32 - source ~/.nvm/nvm.sh
33 - nvm install $NODE_VERSION
34 - nvm use $NODE_VERSION
35 - npm install -g npm@3
36 - node --version
37 - npm --version
38 - nvm --version
39
40 # publish dependencies
41 # ------------------------
42
43 - npm install node-gyp -g
44 - npm install aws-sdk
45
46install:
47
48 # in the first instance we build from source to create the initial binary
49 # which can then be used to create a package
50
51 - npm install --build-from-source
52 - npm test
53
54before_script:
55
56 # Detemine if a publish is required.
57 #
58 # a) we are building a tag
59 # b) we put [publish binary] in the commit message
60
61 - PUBLISH_BINARY=false
62
63 - if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi; # a
64 - if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi; # b
65
66 # package & publish
67 # ------------------------
68
69 - if [[ $PUBLISH_BINARY == true ]]; then npm run node-pre-gyp package publish; fi;
70
71 # clean-up
72 # ------------------------
73
74 - npm run node-pre-gyp clean
75 - node-gyp clean
76
77script:
78
79 # validate
80 # ------------------------
81 # Post publishing a release verify that installing will pull down latest
82 # binary from remote host
83
84 - INSTALL_RESULT=0
85 - if [[ $PUBLISH_BINARY == true ]]; then INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true; fi;
86
87 - npm run node-pre-gyp clean
88
89 # failure?
90 # ------------------------
91 # if install returned non zero (errored) then we first unpublish and then
92 # call false so travis will bail at this line.
93
94 - if [[ $INSTALL_RESULT != 0 ]]; then npm run node-pre-gyp unpublish; fi;
95 - if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";false; fi;
96
97after_success:
98
99 # display all published binaries
100
101 - npm run node-pre-gyp info