.travis.yml 2.8 KB

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