Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
fix: add npm auto publish for master version changes
Browse files Browse the repository at this point in the history
  • Loading branch information
traviscrist committed Jun 15, 2018
1 parent 0e2ca28 commit 8b1c87b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,38 @@ jobs:

- run: npm test

publish_to_npm:
docker:
- image: circleci/node:10

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: mv npmrc-env .npmrc

- run:
name: Publish to NPM (only if a new version has been tagged)
command: if [ "$(npm show codiusd version)" != "$(npm ls --depth=-1 2>/dev/null | head -1 | cut -f 1 -d " " | cut -f 2 -d @)" ] ; then npm publish ; fi

workflows:
version: 2
build:
jobs:
- build_node_v10
- build_node_v8
- publish_to_npm:
requires:
- build_node_v10
filters:
branches:
only:
- master
1 change: 1 addition & 0 deletions npmrc-env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

0 comments on commit 8b1c87b

Please sign in to comment.