-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.yml
157 lines (131 loc) · 2.96 KB
/
config.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:12.13.1
whitelist: &whitelist
paths:
- '**/*'
- '*'
version: 2
jobs:
checkout:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run:
name: Install Dependencies
command: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- persist_to_workspace:
root: ~/repo
<<: *whitelist
lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Lint TypeScript code
command: yarn lint
test:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Test TypeScript code
command: yarn test:cover
- persist_to_workspace:
root: ~/repo
<<: *whitelist
build:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Compile TypeScript code
command: yarn compile
- persist_to_workspace:
root: ~/repo
<<: *whitelist
deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Install dot-json package
command: npm install dot-json
- run:
name: Write version to package.json
command: $(yarn bin)/dot-json package.json version ${CIRCLE_TAG:1}
- run:
name: Publish to NPM
command: npm publish --access=public
workflows:
version: 2
build:
jobs:
- checkout
- test:
requires:
- checkout
- lint:
requires:
- checkout
- build:
requires:
- test
- lint
release:
jobs:
- checkout:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- checkout
- lint:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- checkout
- build:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- test
- lint
- deploy:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- build