version: 2
executorType: docker
jobs:
  test:
    docker:
      - image: circleci/clojure:lein-2.8.1
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ .Branch }}-{{ .Revision }}

      - run: 
          command: lein deploy
           
      - run: lein set-version 99.99.99 
      - run: lein install
      - run: git reset HEAD --hard 

      - save_cache:
          paths:
            - ~/.m2
          key: v1-dependencies-{{ .Branch }}-{{ .Revision }}

  release:
    docker:
      - image: circleci/clojure:lein-2.8.1
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ .Branch }}-{{ .Revision }}

      - run: lein deploy

workflows:
  version: 2
  test-build-deploy:
    jobs:
      - test
      - release:
          requires:
            - test
          filters:
             branches:
               only: master

version: 2
executorType: docker
jobs:
  test:
    docker:
      - image: circleci/clojure:lein-2.8.1
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ .Branch }}-{{ .Revision }}
      - run: lein set-version 99.99.99 
      - run: lein install
      - run: git reset HEAD --hard 

      - save_cache:
          paths:
            - ~/.m2
          key: v1-dependencies-{{ .Branch }}-{{ .Revision }}

  release:
    docker:
      - image: circleci/clojure:lein-2.8.1
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ .Branch }}-{{ .Revision }}

      - run: lein deploy

workflows:
  version: 2
  test-build-deploy:
    jobs:
      - test
      - release:
          requires:
            - test
          filters:
             branches:
               only: master

Fix error in release script.
Fix error in release script.
