language: node_js

node_js:
    - stable

before_install:
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.0
    - export PATH=$HOME/.yarn/bin:$PATH

cache: yarn

install:
    - yarn

before_script:
    - yarn flow
    - yarn lint
    - yarn test

script:
    # Publish canary builds when feature merges back to develop
    - "if [ ${TRAVIS_PULL_REQUEST} = 'false' ]; then yarn canary ; fi"
    # Publish release builds when merges to master
    - "if [ ${TRAVIS_PULL_REQUEST} = 'false' ] && [ ${TRAVIS_BRANCH} = 'master' ]; then yarn release; fi"

# Send coverage data to Coveralls
after_script:
    - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

branches:
    only:
        - master
        - develop

env:
  global:
    - GH_REPO: github.com/iCHEF/gypcrete.git

language: node_js

node_js:
    - stable

before_install:
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.0
    - export PATH=$HOME/.yarn/bin:$PATH

cache: yarn

install:
    - yarn

before_script:
    - yarn flow
    - yarn lint
    - yarn test

script:
    # Auth NPM for publish
    - echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > "${TRAVIS_BUILD_DIR}"/.npmrc
    # Publish canary builds when feature merges back to develop
    - "if [ ${TRAVIS_PULL_REQUEST} = 'false' ]; then yarn canary ; fi"
    # Publish release builds when merges to master
    - "if [ ${TRAVIS_PULL_REQUEST} = 'false' ] && [ ${TRAVIS_BRANCH} = 'master' ]; then yarn release; fi"

# Send coverage data to Coveralls
after_script:
    - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

branches:
    only:
        - master
        - develop

env:
  global:
    - GH_REPO: github.com/iCHEF/gypcrete.git

Use the .npmrc approach to auth 'lerna publish'
Use the .npmrc approach to auth 'lerna publish'
