machine:
  node:
    version: 4
  environment:
    NPM_CONFIG_PROGRESS: false
    NPM_CONFIG_SPIN: false

dependencies:
  pre:
    - npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
    - npm -g install codecov
  override:
    - make install

test:
  override:
    - make test
  post:
    - cp -R coverage $CIRCLE_ARTIFACTS/
    - codecov

deployment:
  publish:
    owner: segmentio
    # Works on e.g. `1.0.0-alpha.1`
    tag: /[0-9]+(\.[0-9]+)*(-.+)?/
    commands:
      - npm publish .
