Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added publish script in CircleCI config #31

Merged
merged 5 commits into from
Mar 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,35 @@ jobs:

- run: yarn run verify

publish:
docker:
- image: circleci/node:latest

working_directory: ~/repo

steps:
- checkout

- run:
name: Add NPM auth token file
command: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc

- run:
name: npm publish if new version
command: |
currentVersion=`npm show console-fail-test version`
nextVersion=`node -e "console.log(require(./package.json').version)"`
[ "$currentVersion" != "$nextVersion" ] && npm publish;

workflows:
version: 2
build_and_end_to_end:
jobs:
- build
- publish:
context: org-global
requires:
- build
filters:
branches:
only: master