From 49433d885f37f3000b08d315b975150c372874e3 Mon Sep 17 00:00:00 2001 From: Graham Smith Date: Mon, 25 Oct 2021 15:50:07 +0100 Subject: [PATCH] chore: add semantic versioning and NPM release to CI workflow --- .circleci/config.yml | 25 ++++++++++++++++++++++--- .releaserc | 16 ++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 .releaserc diff --git a/.circleci/config.yml b/.circleci/config.yml index d694dbd5..869dc83b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,8 +9,6 @@ defaults: &defaults jobs: test: <<: *defaults - docker: - - image: circleci/node:14-buster steps: - checkout - attach_workspace: @@ -24,10 +22,31 @@ jobs: - run: name: Test command: npm test + + release: + <<: *defaults + steps: + - checkout + - run: + name: Install deps + command: npm install + - run: + name: Release + command: npx semantic-release workflows: version: 2 - test: + test_and_publish: jobs: - test: name: Test + + - release: + name: Release + context: nodejs-lib-release + requires: + - Test + filters: + branches: + only: + - main diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000..bd307ade --- /dev/null +++ b/.releaserc @@ -0,0 +1,16 @@ +{ + "branches": "main", + "verifyConditions": [ + "@semantic-release/github" + ], + "prepare": [], + "publish": [ + "@semantic-release/github" + ], + "success": [ + "@semantic-release/github" + ], + "fail": [ + "@semantic-release/github" + ] +}