Skip to content

Commit

Permalink
Publish to npm in circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
kafkas committed Dec 26, 2023
1 parent d87575a commit 5e2d464
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,27 @@ jobs:
name: Run tests
command: npm run test

publish:
executor: node/default
steps:
- checkout
- node/install-packages:
pkg-manager: npm
- run:
name: Compile the source
command: rm -rf dist && npm run compile
- run:
name: Publish to NPM
command: npm publish
- when:
condition: << pipeline.git.tag >>
steps:
- run:
name: Configure NPM
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc

workflows:
lint_and_test:
build_test_deploy:
jobs:
- lint:
name: Run linter and formatter
Expand All @@ -47,3 +66,13 @@ workflows:
filters:
tags:
only: /.*/

- publish:
name: Publish to NPM
requires: [lint, test]
filters:
branches:
only:
- main
tags:
only: /^v\d+\.\d+\.\d+$/

0 comments on commit 5e2d464

Please sign in to comment.