From 315a374298d1db7268fb09af608d5e1786573318 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 11 Feb 2019 08:15:23 +0100 Subject: [PATCH] Add new circleci config --- .circleci/config.yml | 71 +++++++++++++------------------------------- 1 file changed, 20 insertions(+), 51 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af2574b7..2d9dd505 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,60 +6,29 @@ jobs: working_directory: ~/repo steps: - checkout - - run: yarn install - - run: yarn bootstrap - - run: yarn lint - - run: yarn test - publish-stable: - docker: - - image: circleci/node:10 - working_directory: ~/repo - steps: - - checkout - - run: yarn install - - run: yarn bootstrap - run: - name: Saving Authentication Information - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - # - run: - # name: Publishing to Stable Channel - # command: yarn run lerna publish from-git --yes - - publish-canary: - docker: - - image: circleci/node:10 - working_directory: ~/repo - steps: - - checkout - - run: yarn install - - run: yarn bootstrap + name: Installing dependencies + command: yarn install - run: - name: Saving Authentication Information - command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + name: Bootstrapping + command: yarn bootstrap - run: - name: Publishing to Canary Channel - command: yarn run lerna publish from-git --npm-tag canary --yes + name: Linting + command: yarn lint + - run: + name: Tests + command: yarn test + - run: + name: Potentially save npm token + command: "([[ ! -z $NPM_TOKEN ]] && echo \"//registry.npmjs.org/:_authToken=$NPM_TOKEN\" >> ~/.npmrc) || echo \"Did not write npm token\"" + - run: + name: Potentially publish canary release + command: "if ls ~/.npmrc >/dev/null 2>&1 && [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; then yarn run lerna publish from-git --npm-tag canary --yes; else echo \"Did not publish\"; fi" + - run: + name: Potentially publish stable release + command: "if ls ~/.npmrc >/dev/null 2>&1 && [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; then yarn run lerna publish from-git --yes; else echo \"Did not publish\"; fi" workflows: version: 2 - unscheduled: + build-and-deploy: jobs: - - build: - filters: - tags: - only: /.*/ - - publish-canary: - requires: - - build - filters: - tags: - only: /^.*canary.*($|\b)/ - branches: - ignore: /.*/ - - publish-stable: - requires: - - build - filters: - tags: - only: /^(\d+\.)?(\d+\.)?(\*|\d+)$/ - branches: - ignore: /.*/ \ No newline at end of file + - build \ No newline at end of file