Skip to content

Commit

Permalink
Add publish job
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewJo committed Apr 1, 2022
1 parent 37607bd commit 02a94c6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ jobs:
- store_artifacts:
path: package
destination: .
publish:
docker:
- image: cimg/node:lts
working_directory: ~/express-slonik
steps:
- attach_workspace:
at: ~/express-slonik
- run:
name: Set NPM token
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- when:
condition: << pipeline.git.tag >>
steps:
- run: npm publish
- unless:
condition: << pipeline.git.tag >>
steps:
- run: npm publish --dry-run

workflows:
build-and-publish:
Expand All @@ -65,3 +83,12 @@ workflows:
filters:
tags:
only: /v\d+(?:\.\d+){0,2}(?:-\w+(?:\.\w+)*){0,1}/
- publish:
context: npm
requires:
- build
filters:
branches:
only: master
tags:
only: /v\d+(?:\.\d+){0,2}(?:-\w+(?:\.\w+)*){0,1}/

0 comments on commit 02a94c6

Please sign in to comment.