Created
December 12, 2017 20:45
-
-
Save rockchalkwushock/c82b83e1bf0bb72438e1c32754d81b85 to your computer and use it in GitHub Desktop.
Having problems with new NPM 2FA and publishing on CircleCI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
checkout_code: | |
docker: | |
- image: circleci/node:latest | |
working_directory: ~/microauth-vkontakte | |
steps: | |
- checkout | |
- attach_workspace: | |
at: ~/microauth-vkontakte | |
- restore_cache: | |
keys: | |
- yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} | |
- yarn-cache-{{ .Branch }} | |
- yarn-cache- | |
- run: yarn install | |
- save_cache: | |
key: yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} | |
paths: node_modules | |
# Add ~/.npmrc with authToken through NPM_TOKEN to publish. | |
- run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc' | |
- persist_to_workspace: | |
root: . | |
paths: . | |
test: | |
docker: | |
- image: circleci/node:latest | |
working_directory: ~/microauth-vkontakte | |
steps: | |
- attach_workspace: | |
at: ~/microauth-vkontakte | |
# Install dependencies | |
- run: yarn install | |
# Using `nsp` check for vulnerabilities in package dependencies. | |
- run: yarn start validate.dependencies | |
# Validate the code through: linting, type-checking, & testing that will generate coverage. | |
- run: yarn start validate.withCoverage | |
# Report coverage to CodeCov. | |
- run: yarn start reportCoverage | |
- store_artifacts: | |
path: ./coverage/clover.xml | |
prefix: tests | |
- store_artifacts: | |
path: coverage | |
prefix: coverage | |
- store_test_results: | |
path: ./coverage/clover.xml | |
release: | |
docker: | |
- image: circleci/node:latest | |
working_directory: ~/microauth-vkontakte | |
steps: | |
- attach_workspace: | |
at: ~/microauth-vkontakte | |
- run: yarn install | |
- run: yarn start release || true | |
workflows: | |
version: 2 | |
test_and_release: | |
jobs: | |
- checkout_code | |
- test: | |
requires: | |
- checkout_code | |
- hold: | |
type: approval | |
requires: | |
- test | |
filters: | |
branches: | |
only: master | |
- release: | |
requires: | |
- hold | |
filters: | |
branches: | |
only: master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment