File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/
2+
3+ version : 2
4+
5+ defaults : &defaults
6+ working_directory : ~/repo
7+ docker :
8+ - image : circleci/node:10.15.0
9+
10+ jobs :
11+ test :
12+ << : *defaults
13+ steps :
14+ - checkout
15+
16+ - restore_cache :
17+ keys :
18+ - v1-dependencies-{{ checksum "package.json" }}
19+ # fallback to using the latest cache if no exact match is found
20+ - v1-dependencies-
21+
22+ - run : npm install
23+ - run :
24+ name : Run tests
25+ command : npm test
26+
27+ - save_cache :
28+ paths :
29+ - node_modules
30+ key : v1-dependencies-{{ checksum "package.json" }}
31+
32+ - persist_to_workspace :
33+ root : ~/repo
34+ paths : .
35+ deploy :
36+ << : *defaults
37+ steps :
38+ - attach_workspace :
39+ at : ~/repo
40+ - run :
41+ name : Authenticate with registry
42+ command : echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
43+ - run :
44+ name : Publish package
45+ command : npm publish
46+
47+ workflows :
48+ version : 2
49+ test-deploy :
50+ jobs :
51+ - test :
52+ filters :
53+ tags :
54+ only : /^v[0-9]+\.[0-9]+\.[0-9]/
55+ - deploy :
56+ requires :
57+ - test
58+ filters :
59+ tags :
60+ only : /^v[0-9]+\.[0-9]+\.[0-9]/
61+ branches :
62+ ignore : /.*/
Original file line number Diff line number Diff line change 1313 },
1414 "scripts" : {
1515 "build" : " rimraf ./dist && tsc --build tsconfig.json" ,
16- "start" : " node ./dist/main.js"
16+ "start" : " node ./dist/main.js" ,
17+ "test" : " echo TODO: Tests"
1718 },
1819 "repository" : {
1920 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments