@kendallgassner/eslint-plugin-package-json
Version:
Rules for valid, consistent, and readable package.json files
67 lines (63 loc) • 1.58 kB
YAML
version: 2
# This key means nothing to CircleCI; it's just a place to keep anchored
# configuration nodes for reuse.
common_settings:
working_directory: &workdir ~/project
cache_key: &cachekey 'v1-npm-cache-{{ .Branch }}'
docker:
- image: 'circleci/node:8.11.2'
install_latest_npm:
name: Ensure NPM is up to date
command: sudo npm install -g npm@latest
jobs:
test:
docker:
working_directory:
steps:
- checkout
- restore_cache:
keys:
-
- v1-npm-cache-
- run:
- run: npm ci
- run: npm test
- save_cache:
paths:
- ~/.ssh
- ~/.npm
- /root/.npm
key:
- persist_to_workspace:
root:
paths:
- .
deploy:
docker:
working_directory:
steps:
- attach_workspace:
at:
- run:
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- run:
name: Publish package
command: npm publish --access=public
workflows:
version: 2
test-and-deploy:
jobs:
- test:
filters:
tags:
only: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/