File tree Expand file tree Collapse file tree 1 file changed +28
-15
lines changed Expand file tree Collapse file tree 1 file changed +28
-15
lines changed Original file line number Diff line number Diff line change 1
- version : 2
1
+ version : 2.1
2
2
3
3
defaults : &defaults
4
4
working_directory : ~/repo
5
5
docker :
6
- - image : circleci/node:12.16.2
6
+ - image : cimg/node:14.19
7
+
8
+ _steps :
9
+ restore_npm_cache : &restore_npm_cache
10
+ restore_cache :
11
+ keys :
12
+ - npm-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}
13
+ - npm-v1-{{ .Branch }}-
14
+ - npm-v1-
15
+ save_npm_cache : &save_npm_cache
16
+ save_cache :
17
+ paths :
18
+ - .npm-cache
19
+ key : npm-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}
20
+ configure_registry_auth : &configure_registry_auth
21
+ run :
22
+ name : Configure registry auth
23
+ command : echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/repo/.npmrc
7
24
8
25
jobs :
9
26
test :
10
27
<< : *defaults
11
28
steps :
12
29
- checkout
13
- - restore_cache :
14
- keys :
15
- - v1-dependencies-{{ checksum "package-lock.json" }}
16
- # fallback to using the latest cache if no exact match is found
17
- - v1-dependencies-
18
- - run : npm ci
30
+ - *restore_npm_cache
31
+ - *configure_registry_auth
32
+ - run : npm ci --cache .npm-cache
19
33
- run :
20
34
name : Run coverage tests
21
35
command : npm run test:coverage
22
36
- run :
23
37
name : Run build
24
38
command : npm run build
25
- - save_cache :
26
- paths :
27
- - node_modules
28
- key : v1-dependencies-{{ checksum "package-lock.json" }}
29
39
- persist_to_workspace :
30
40
root : ~/repo
31
41
paths : .
32
42
- store_artifacts :
33
43
path : ~/repo/dist
44
+ - *save_npm_cache
34
45
deploy :
35
46
<< : *defaults
36
47
steps :
37
48
- attach_workspace :
38
49
at : ~/repo
39
- - run :
40
- name : Configure registry auth
41
- command : echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/repo/.npmrc
50
+ - *configure_registry_auth
42
51
- run :
43
52
name : Publish package
44
53
# For now we only publish on tags here and assume the version number is already correct.
@@ -50,10 +59,14 @@ workflows:
50
59
test-deploy :
51
60
jobs :
52
61
- test :
62
+ context :
63
+ - " NPM Read"
53
64
filters :
54
65
tags :
55
66
only : /^v.*/
56
67
- deploy :
68
+ context :
69
+ - " NPM Write"
57
70
requires :
58
71
- test
59
72
filters :
You can’t perform that action at this time.
0 commit comments