File tree Expand file tree Collapse file tree 1 file changed +77
-0
lines changed Expand file tree Collapse file tree 1 file changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ version : 2.1
2+
3+ jobs :
4+ run-tests :
5+ parameters :
6+ node-version :
7+ type : string
8+ docker :
9+ - image : cimg/node:<< parameters.node-version >> # Primary execution image
10+ auth :
11+ username : $DOCKERHUB_USERNAME
12+ password : $DOCKERHUB_PASSWORD
13+ - image : mongo:4.2
14+ auth :
15+ username : $DOCKERHUB_USERNAME
16+ password : $DOCKERHUB_PASSWORD
17+ steps :
18+ - checkout
19+ - run :
20+ name : NPM install
21+ command : npm ci
22+ - run :
23+ name : Run linting
24+ command : npm run lint
25+ - run :
26+ name : Run tests with coverage
27+ command : npm run coverage
28+ - store_artifacts :
29+ path : coverage
30+ publish-npm :
31+ docker :
32+ - image : cimg/node:16.15.0 # Primary execution image
33+ auth :
34+ username : $DOCKERHUB_USERNAME
35+ password : $DOCKERHUB_PASSWORD
36+ steps :
37+ - checkout
38+ - run :
39+ name : NPM install
40+ command : npm ci
41+ - run :
42+ name : Authenticate with NPM
43+ command : npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
44+ - run :
45+ name : Publish package
46+ command : |
47+ # Publish as beta for pre-release tags like v1.2.3-pre.1
48+ [[ $CIRCLE_TAG =~ ^v.*- ]] && NPM_TAG=--tag=beta
49+ npm publish $NPM_TAG
50+
51+ workflows :
52+ version : 2
53+ test-and-publish :
54+ jobs :
55+ - run-tests :
56+ context :
57+ - particle-ci-private
58+ matrix :
59+ parameters :
60+ node-version : ["12.22.12", "14.19.2", "16.15.0"]
61+ # run tests for all branches and tags
62+ filters :
63+ tags :
64+ only : /^v.*/
65+ branches :
66+ only : /.*/
67+ - publish-npm :
68+ requires :
69+ - run-tests
70+ context :
71+ - particle-ci-private
72+ # publish for tags only
73+ filters :
74+ tags :
75+ only : /^v.*/
76+ branches :
77+ ignore : /.*/
You can’t perform that action at this time.
0 commit comments