Skip to content

Commit ebcaf65

Browse files
committed
Add CircleCI config
1 parent dd9f5e9 commit ebcaf65

File tree

1 file changed

+151
-0
lines changed

1 file changed

+151
-0
lines changed

.circleci/config.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:8
6+
working_directory: ~/repo
7+
steps:
8+
- checkout
9+
- run: npm install
10+
- run: npm run lint
11+
- persist_to_workspace:
12+
root: ~/repo
13+
paths: .
14+
test-node8:
15+
docker:
16+
- image: circleci/node:8
17+
working_directory: ~/repo
18+
steps:
19+
- attach_workspace:
20+
at: ~/repo
21+
- run: npm run test:ci
22+
test-node9:
23+
docker:
24+
- image: circleci/node:9
25+
working_directory: ~/repo
26+
steps:
27+
- attach_workspace:
28+
at: ~/repo
29+
- run: npm run test:ci
30+
test-node10:
31+
docker:
32+
- image: circleci/node:10
33+
working_directory: ~/repo
34+
steps:
35+
- attach_workspace:
36+
at: ~/repo
37+
- run: npm run test:ci
38+
test-node11:
39+
docker:
40+
- image: circleci/node:11
41+
working_directory: ~/repo
42+
steps:
43+
- attach_workspace:
44+
at: ~/repo
45+
- run: npm run test:ci
46+
test-node12:
47+
docker:
48+
- image: circleci/node:12
49+
working_directory: ~/repo
50+
steps:
51+
- attach_workspace:
52+
at: ~/repo
53+
- run: npm run test:ci
54+
publish-beta:
55+
docker:
56+
- image: circleci/node:10
57+
working_directory: ~/repo
58+
steps:
59+
- attach_workspace:
60+
at: ~/repo
61+
- run:
62+
name: Authenticate with registry
63+
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" >> ~/.npmrc
64+
- run:
65+
name: Publish to beta channel
66+
command: npm publish --tag beta
67+
publish-stable:
68+
docker:
69+
- image: circleci/node:10
70+
working_directory: ~/repo
71+
steps:
72+
- attach_workspace:
73+
at: ~/repo
74+
- run:
75+
name: Authenticate with registry
76+
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" >> ~/.npmrc
77+
- run:
78+
name: Publish to stable channel
79+
command: npm publish --tag latest
80+
81+
workflows:
82+
version: 2
83+
build-test-and-publish:
84+
jobs:
85+
- build:
86+
filters:
87+
tags:
88+
only: /.*/
89+
- test-node8:
90+
requires:
91+
- build
92+
filters:
93+
tags:
94+
only: /.*/
95+
- test-node9:
96+
requires:
97+
- build
98+
filters:
99+
tags:
100+
only: /.*/
101+
- test-node10:
102+
requires:
103+
- build
104+
filters:
105+
tags:
106+
only: /.*/
107+
- test-node11:
108+
requires:
109+
- build
110+
filters:
111+
tags:
112+
only: /.*/
113+
- test-node12:
114+
requires:
115+
- build
116+
filters:
117+
tags:
118+
only: /.*/
119+
- publish-beta:
120+
requires:
121+
- test-node8
122+
- test-node9
123+
- test-node10
124+
- test-node11
125+
- test-node12
126+
filters:
127+
tags:
128+
only: /^v\d*\.\d*\.\d*-beta\.\d*$/
129+
branches:
130+
ignore: /.*/
131+
- hold:
132+
type: approval
133+
requires:
134+
- test-node8
135+
- test-node9
136+
- test-node10
137+
- test-node11
138+
- test-node12
139+
filters:
140+
tags:
141+
only: /^v\d*\.\d*\.\d*$/
142+
branches:
143+
ignore: /.*/
144+
- publish-stable:
145+
requires:
146+
- hold
147+
filters:
148+
tags:
149+
only: /^v\d*\.\d*\.\d*$/
150+
branches:
151+
ignore: /.*/

0 commit comments

Comments
 (0)