1 | version: 2
|
2 |
|
3 | buildSteps: &buildSteps
|
4 | - checkout
|
5 | - run:
|
6 | name: Install
|
7 | command: npm install --loglevel warn
|
8 | - run:
|
9 | name: Test
|
10 | command: npm test --loglevel warn
|
11 | - persist_to_workspace:
|
12 |
|
13 | root: ../
|
14 | paths:
|
15 | - ./node-*
|
16 |
|
17 | jobs:
|
18 | node-6:
|
19 | docker:
|
20 | - image: circleci/node:6
|
21 | working_directory: ~/node-6
|
22 | steps: *buildSteps
|
23 |
|
24 | node-8:
|
25 | docker:
|
26 | - image: circleci/node:8
|
27 | working_directory: ~/node-8
|
28 | steps: *buildSteps
|
29 |
|
30 | node-10:
|
31 | docker:
|
32 | - image: circleci/node:10
|
33 | working_directory: ~/node-10
|
34 | steps: *buildSteps
|
35 |
|
36 | deploy:
|
37 |
|
38 | docker:
|
39 | - image: circleci/node:8
|
40 | steps:
|
41 | - attach_workspace:
|
42 | at: $CIRCLE_WORKING_DIRECTORY
|
43 | - run:
|
44 | name: Login
|
45 | command: |
|
46 | echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
47 | npm whoami
|
48 | - deploy:
|
49 | name: Deploy
|
50 | command: npm publish
|
51 |
|
52 | working_directory: $CIRCLE_WORKING_DIRECTORY/node-8
|
53 |
|
54 | workflows:
|
55 | version: 2
|
56 | build:
|
57 | jobs:
|
58 | - node-6:
|
59 |
|
60 | filters:
|
61 | tags:
|
62 | only: /.*/
|
63 | - node-8:
|
64 |
|
65 | filters:
|
66 | tags:
|
67 | only: /.*/
|
68 | - node-10:
|
69 |
|
70 | filters:
|
71 | tags:
|
72 | only: /.*/
|
73 | - deploy:
|
74 |
|
75 | requires:
|
76 | - node-6
|
77 | - node-8
|
78 | - node-10
|
79 | filters:
|
80 | tags:
|
81 | only: /^v\d+\.\d+\.\d+$/
|
82 | branches:
|
83 | ignore: /.*/
|