-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
88 lines (86 loc) · 2.01 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
default_image: &default_image
working_directory: ~/repo
docker:
- image: circleci/node:7.10
default_filters: &default_filters
filters:
tags:
only: /.*/
branches:
only: /.*/
version: 2
jobs:
install:
<<: *default_image
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
format:
<<: *default_image
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm run format:check
test:
<<: *default_image
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm run test
- run: npm run coverage
build:
<<: *default_image
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm run build
- save_cache:
key: dependency-cache-build-{{ checksum "package.json" }}
paths:
- ~/repo/lib
publish_npm:
<<: *default_image
steps:
- checkout
- restore_cache:
key: dependency-cache-build-{{ checksum "package.json" }}
- run: echo -e "$NPM_USER\n$NPM_PASS\n$NPM_EMAIL" | npm login
- run: npm publish
workflows:
version: 2
build_test_deploy:
jobs:
- install:
<<: *default_filters
- format:
<<: *default_filters
requires:
- install
- test:
<<: *default_filters
requires:
- install
- build:
<<: *default_filters
requires:
- install
- publish_npm:
context: npm-user
requires:
- format
- test
- build
filters:
tags:
only: /.*/
branches:
ignore: /.*/