From b10cb52caa3239dd69d50a42e3b5cb5d54e17de1 Mon Sep 17 00:00:00 2001 From: harshavardhanc Date: Thu, 11 Jun 2020 18:06:46 +0530 Subject: [PATCH] Isssue #00 fix: npm publish on pr merge --- .circleci/config.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b5be6a..c2e2486 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,8 +9,17 @@ jobs: - run: npm install -g @angular/cli - run: npm install - run: ng build - - run: npm pack ~/project/dist/chat-lib + - run: + name: Publish to NPM + command: | + if [ -z $CIRCLE_PR_NUMBER ]; then + npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN + npm pack ~/project/dist/chat-lib + npm publish sunbird-chatbot-client-* + else + echo "Nothing to publish!" + fi workflows: version: 2.1 build_and_test: