language: node_js
node_js:
  - 8
cache: yarn

# Define global C++ compiler version
env:
  global:
    - CXX=g++-4.8
before_install:
  # Yarn defaults to an old version, make sure we
  # get an up to date version
  - npm install -g yarn
before_script:
  - cp config/ci.config.json config/project.json
script:
  - xvfb-run yarn test
after_success:
  - yarn test:coverage

# Misc Addons/Configs
dist: trusty
sudo: required
addons:
  apt:
    sources:
      - google-chrome
      - ubuntu-toolchain-r-test
    packages:
      - google-chrome-stable
      - g++-4.8

# NPM Canary Build Config
deploy:
  skip_cleanup: true
  provider: script
  script: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc && yarn release --canary
  on:
    branch: master

language: node_js
node_js:
  - 8
cache: yarn

# Define global C++ compiler version
env:
  global:
    - CXX=g++-4.8
before_install:
  # Yarn defaults to an old version, make sure we
  # get an up to date version
  - npm install -g yarn
  - echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
before_script:
  - cp config/ci.config.json config/project.json
script:
  - xvfb-run yarn test
after_success:
  - yarn test:coverage

# Misc Addons/Configs
dist: trusty
sudo: required
addons:
  apt:
    sources:
      - google-chrome
      - ubuntu-toolchain-r-test
    packages:
      - google-chrome-stable
      - g++-4.8

# NPM Canary Build Config
deploy:
  skip_cleanup: true
  provider: script
  script: yarn release --canary
  on:
    branch: master

Move the .npmrc creation to a before_install step
Move the .npmrc creation to a before_install step
