From d10c38bb119afb0a3a4a280c0aff6ede072c7d0f Mon Sep 17 00:00:00 2001 From: Timothy <1695613+timothyis@users.noreply.github.com> Date: Tue, 13 Mar 2018 19:44:11 +0000 Subject: [PATCH] Update to CircleCI 2 (#2758) * Initial circlci version 2 config file * Fix step 3 structure * Formatting * Add run before conditional * Storing artifacts * Better config structure and use workflows for conditions etc. * Potentially fix artifact upload * Check if artifacts build which just a general path * Finish up * Remove test branch --- .circleci/config.yml | 87 ++++++++++++++++++++++++++++++++++++++++++++ circle.yml | 34 ----------------- 2 files changed, 87 insertions(+), 34 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..b45679c3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,87 @@ +version: 2 +jobs: + install: + macos: + xcode: "9.2.0" + working_directory: ~/repo + steps: + - checkout + - restore_cache: + key: cache-{{ checksum "yarn.lock" }} + - run: + name: Installing Dependencies + command: yarn --ignore-engines + - save_cache: + key: cache-{{ checksum "yarn.lock" }} + paths: + - node_modules + - run: + name: Getting build icon + command: if [[ $CIRCLE_BRANCH == canary ]]; then cp build/canary.icns build/icon.icns; fi + - persist_to_workspace: + root: . + paths: + - node_modules + + test: + macos: + xcode: "9.2.0" + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Testing + command: yarn test + + build: + macos: + xcode: "9.2.0" + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Building + command: yarn dist --publish 'never' + - store_artifacts: + path: dist + - persist_to_workspace: + root: . + paths: + - dist + + release: + macos: + xcode: "9.2.0" + steps: + - checkout + - run: + name: Deploying to GitHub + command: yarn dist + + +workflows: + version: 2 + build: + jobs: + - install + - build: + requires: + - install + filters: + branches: + only: + - master + - canary + - test: + requires: + - build + - release: + requires: + - test + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ diff --git a/circle.yml b/circle.yml deleted file mode 100644 index ca2745ac..00000000 --- a/circle.yml +++ /dev/null @@ -1,34 +0,0 @@ -machine: - xcode: - version: "9.0" - pre: - - mkdir ~/.yarn-cache - -dependencies: - pre: - - yarn config set cache-folder ~/.yarn-cache - cache_directories: - - ~/.yarn-cache - override: - - yarn - -checkout: - post: - - if [[ "$CIRCLE_BRANCH" == "canary" ]]; then cp build/canary.icns build/icon.icns; fi - -test: - override: - - yarn test - -deployment: - artifacts: - branch: /^(?!master$).*$/ - owner: zeit - commands: - - yarn run dist -- -p 'never' - - cp dist/*.zip $CIRCLE_ARTIFACTS - release: - tag: /.*/ - owner: zeit - commands: - - yarn run dist