From 94136d834c2cedf039509983901cbcd29cf4eb09 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Thu, 10 Oct 2019 11:18:11 +0100 Subject: [PATCH] Publish tags to NPM. --- .circleci/config.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a34f89..9ec2126 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,9 +31,33 @@ jobs: paths: . - store_artifacts: path: ~/repo/dist + deploy: + <<: *defaults + steps: + - attach_workspace: + at: ~/repo + - run: + name: Configure registry auth + command: echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/repo/.npmrc + - run: + name: Publish package + # For now we only publish on tags here and assume the version number is already correct. + # If we change this then we need to automate updating the version number. + command: npm publish $(if [ -z "$CIRCLE_TAG" ]; then echo "--tag next"; fi) workflows: version: 2 - test: + test-deploy: jobs: - - test_and_build + - test_and_build: + filters: + tags: + only: /^v.*/ + - deploy: + requires: + - test_and_build + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/