message: Setup pushing to npm at circle ci
diff: # Check https://circleci.com/docs/2.0/language-javascript/ for more details
  #
  version: 2
  -jobs:
  - build:
  +
  +defaults: &defaults
  + working_directory: ~/repo
  docker:
  - image: circleci/node:8.15
  - working_directory: ~/repo
  +jobs:
  + test:
  + <<: *defaults
  steps:
  - checkout
  @@ -22,10 +25,44 @@ jobs:
  - run: npm install
  + - run:
  + name: Run TypeScript
  + command: npm run tsc
  + - run:
  + name: Run tests
  + command: npm test
  +
  - save_cache:
  paths:
  - node_modules
  key: v1-dependencies-{{ checksum "package.json" }}
  - - run: npm run tsc
  - - run: npm run test
  + - persist_to_workspace:
  + root: ~/repo
  + paths: .
  +
  + deploy:
  + <<: *defaults
  + steps:
  + - attach_workspace:
  + at: ~/repo
  + - run:
  + name: Authenticate with registry
  + command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
  + - run:
  + name: Publish package
  + command: npm publish
  +
  +workflows:
  + version: 2
  + test-deploy:
  + jobs:
  + - test
  + - deploy:
  + requires:
  + - test
  + filters:
  + tags:
  + only: /^v.*/
  + branches:
  + only: master
  