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