diff --git a/.circleci/config.yml b/.circleci/config.yml index af0b4fa..381592b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,9 +26,33 @@ jobs: - persist_to_workspace: root: ~/repo paths: . + 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-deploy: jobs: - - test + - test: + filters: + tags: + only: /^v.*/ + - deploy: + requires: + - test + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ diff --git a/package.json b/package.json index 5b0cc11..749c737 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@microbit-foundation/microbit-universal-hex", + "name": "@microbit/microbit-universal-hex", "version": "0.1.0", "description": "Create micro:bit Universal Hexes.", "keywords": [