1 | language: node_js
|
2 | node_js:
|
3 | - "10"
|
4 |
|
5 | os:
|
6 | - linux
|
7 |
|
8 | cache:
|
9 | directories:
|
10 | - node_modules
|
11 |
|
12 | stages:
|
13 | - test
|
14 | - pack
|
15 | - name: deploy
|
16 | if: (type = push) AND branch =~ ^(master|v\d+\.\d+)$
|
17 |
|
18 | install:
|
19 | - npm install
|
20 |
|
21 | jobs:
|
22 | include:
|
23 |
|
24 | - stage: test
|
25 | script:
|
26 | - node --version
|
27 | - npm --version
|
28 | - echo "Testing Started ..."
|
29 | - npm test
|
30 | - echo "Testing Finished"
|
31 |
|
32 | - stage: pack
|
33 | script:
|
34 | - echo "NPM Pack Testing Started ..."
|
35 | - npm version
|
36 | - npm run test:pack
|
37 | - echo "NPM Pack Testing Finished."
|
38 |
|
39 | - stage: deploy
|
40 | script:
|
41 | - echo "NPM Deploying Started ..."
|
42 | - npm version
|
43 | - ./scripts/package-publish-config-tag.sh
|
44 | - npm run dist
|
45 | - echo "NPM Building Finished."
|
46 |
|
47 | deploy:
|
48 | provider: npm
|
49 | email: zixia@zixia.net
|
50 | api_key: "$NPM_TOKEN"
|
51 | skip_cleanup: true
|
52 | on:
|
53 | all_branches: true
|
54 |
|
55 | notifications:
|
56 | webhooks:
|
57 | urls:
|
58 | - https://webhooks.gitter.im/e/41a19fbf1d54a04e5217
|
59 | on_success: always
|
60 | on_failure: always
|
61 | on_start: never
|
62 | email:
|
63 | on_success: change
|
64 | on_failure: change
|