defaults: &defaults
  working_directory: ~/thrift-server
  docker:
    - image: circleci/node:6.10.3

version: 2
jobs:
  test:
    <<: *defaults
    steps:
      - checkout
      - attach_workspace:
          at: ./
      - run:
          name: install-npm
          command: npm install
      - run:
          name: npm-test
          command: npm test

  publish:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: npm-token
          command: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
      - run:
          name: install-npm
          command: npm install
      - run:
          name: npm-build
          command: npm run build
      - run:
          name: publish-npm
          command: npm run release:publish

workflows:
  version: 2
  build_test:
      jobs:
        - test:
            filters:
              tags:
                only: /.*/
        - publish:
            requires:
              - test
            filters:
              tags:
                only: /(v)?[0-9]+(\.[0-9]+)*/
              branches:
                ignore: /.*/

defaults: &defaults
  working_directory: ~/thrift-server
  docker:
    - image: circleci/node:6.10.3

version: 2
jobs:
  test:
    <<: *defaults
    steps:
      - checkout
      - attach_workspace:
          at: ./
      - run:
          name: install-npm
          command: npm install
      - run:
          name: npm-test
          command: npm test

  publish:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: npm-token
          command: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
      - run:
          name: install-npm
          command: npm install
      - run:
          name: npm-build
          command: npm run build
      - run:
          name: publish-npm
          command: |
            npm publish ./packages/thrift-server-core --access public
            npm publish ./packages/thrift-server-hapi --access public
            npm publish ./packages/thrift-server-express --access public
            npm publish ./packages/thrift-client --access public

workflows:
  version: 2
  build_test:
      jobs:
        - test:
            filters:
              tags:
                only: /.*/
        - publish:
            requires:
              - test
            filters:
              tags:
                only: /(v)?[0-9]+(\.[0-9]+)*/
              branches:
                ignore: /.*/

Call npm publish without lerna
Call npm publish without lerna
