diff --git a/.circleci/config.yml b/.circleci/config.yml index 084f887f..ec2acb94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,9 +9,9 @@ jobs: # Download and cache dependencies - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- - run: npm i - save_cache: paths: @@ -24,3 +24,21 @@ jobs: - persist_to_workspace: root: ~/repo paths: . + release: + docker: + - image: circleci/node:10.16.3 + steps: + - checkout + - run: npm install + - run: npm run build + - run: npx semantic-release + +workflows: + version: 2 + test_and_release: + # Run the test jobs first, then the release only when all the test jobs are successful + jobs: + - build + - release: + requires: + - build diff --git a/commitlint.config.js b/commitlint.config.js index 4fedde6d..422b1944 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1 @@ -module.exports = { extends: ['@commitlint/config-conventional'] } +module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/package.json b/package.json index d591d8d1..46a86596 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "rollup-plugin-commonjs": "10.1.0", "rollup-plugin-node-resolve": "5.2.0", "rollup-plugin-terser": "5.1.2", + "semantic-release": "^15.13.24", "yargs": "14.0.0" }, "peerDependencies": {