1+ defaults : &defaults
2+ working_directory : ~/repo
3+ docker :
4+ - image : circleci/node:8.0
5+
6+ whitelist : &whitelist
7+ paths :
8+ - .npmignore
9+ - coverage/*
10+ - dist/*
11+ - node_modules/*
12+ - src/*
13+ - test/*
14+ - vendor/*
15+ - CODE_OF_CONDUCT.md
16+ - LICENSE.md
17+ - package.json
18+ - README.md
19+ - tsconfig.json
20+ - tslint.json
21+ - yarn.lock
22+ version : 2
23+ jobs :
24+ checkout :
25+ << : *defaults
26+
27+ steps :
28+ - checkout
29+
30+ - restore_cache :
31+ keys :
32+ - v1-dependencies-{{ checksum "package.json" }}
33+ - v1-dependencies-
34+
35+ - run :
36+ name : Install Dependencies
37+ command : yarn install
38+
39+ - save_cache :
40+ paths :
41+ - node_modules
42+ key : v1-dependencies-{{ checksum "package.json" }}
43+
44+ - persist_to_workspace :
45+ root : ~/repo
46+ << : *whitelist
47+
48+ lint :
49+ << : *defaults
50+
51+ steps :
52+ - attach_workspace :
53+ at : ~/repo
54+
55+ - run :
56+ name : Lint TypeScript code
57+ command : yarn lint
58+
59+ test :
60+ << : *defaults
61+
62+ steps :
63+ - attach_workspace :
64+ at : ~/repo
65+
66+ - run :
67+ name : Test TypeScript code
68+ command : yarn test:cover
69+
70+ - persist_to_workspace :
71+ root : ~/repo
72+ << : *whitelist
73+
74+ coveralls :
75+ << : *defaults
76+
77+ steps :
78+ - attach_workspace :
79+ at : ~/repo
80+
81+ - run :
82+ name : Submit coverage report to Coveralls.io
83+ command : yarn coveralls
84+
85+ build :
86+ << : *defaults
87+
88+ steps :
89+ - attach_workspace :
90+ at : ~/repo
91+
92+ - run :
93+ name : Build TypeScript code
94+ command : yarn build
95+
96+ - persist_to_workspace :
97+ root : ~/repo
98+ << : *whitelist
99+
100+ deploy :
101+ << : *defaults
102+
103+ steps :
104+ - attach_workspace :
105+ at : ~/repo
106+
107+ - run :
108+ name : Write NPM Token to ~/.npmrc
109+ command : echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
110+
111+ - run :
112+ name : Install dot-json package
113+ command : npm install dot-json
114+
115+ - run :
116+ name : Write version to package.json
117+ command : $(yarn bin)/dot-json package.json version ${CIRCLE_TAG:1}
118+
119+ - run :
120+ name : Publish to NPM
121+ command : npm publish --access=public
122+
123+ workflows :
124+ version : 2
125+
126+ build :
127+ jobs :
128+ - checkout
129+ - test :
130+ requires :
131+ - checkout
132+ - lint :
133+ requires :
134+ - checkout
135+ - coveralls :
136+ requires :
137+ - test
138+ - build :
139+ requires :
140+ - test
141+ - lint
142+
143+ release :
144+ jobs :
145+ - checkout :
146+ filters :
147+ tags :
148+ only : /v[0-9]+(\.[0-9]+)*/
149+ branches :
150+ ignore : /.*/
151+ - test :
152+ filters :
153+ tags :
154+ only : /v[0-9]+(\.[0-9]+)*/
155+ branches :
156+ ignore : /.*/
157+ requires :
158+ - checkout
159+ - lint :
160+ filters :
161+ tags :
162+ only : /v[0-9]+(\.[0-9]+)*/
163+ branches :
164+ ignore : /.*/
165+ requires :
166+ - checkout
167+ - coveralls :
168+ filters :
169+ tags :
170+ only : /v[0-9]+(\.[0-9]+)*/
171+ branches :
172+ ignore : /.*/
173+ requires :
174+ - test
175+ - build :
176+ filters :
177+ tags :
178+ only : /v[0-9]+(\.[0-9]+)*/
179+ branches :
180+ ignore : /.*/
181+ requires :
182+ - test
183+ - lint
184+ - deploy :
185+ filters :
186+ tags :
187+ only : /v[0-9]+(\.[0-9]+)*/
188+ branches :
189+ ignore : /.*/
190+ requires :
191+ - build
0 commit comments