-
Notifications
You must be signed in to change notification settings - Fork 20
/
.gitlab-ci.yml
67 lines (59 loc) · 1.23 KB
/
.gitlab-ci.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
image: node:14
cache:
key: '$CI_BUILD_REF_NAME'
untracked: true
paths:
- node_modules/
stages:
- prepare
- verify
- test
- publish
before_script:
- VERSION=$([ ! -z $CI_COMMIT_TAG ] && echo ${CI_COMMIT_TAG} || echo ${CI_COMMIT_REF_NAME})
- echo VERSION=$VERSION
codestyle:
stage: verify
script:
- npm ci
- npm run lint
# - npm audit
node:10:
stage: test
image: node:10
only:
- /^v\d+\.\d+\.\d+(-rc.\d+|)$/
script:
- npm i
- npm run unit
coverage: /^All files[^|]*\|[^|]*\s+([\d\.]+)/
node:12:
stage: test
image: node:12
only:
- /^v\d+\.\d+\.\d+(-rc.\d+|)$/
script:
- npm i
- npm run unit
coverage: /^All files[^|]*\|[^|]*\s+([\d\.]+)/
node:14:
stage: test
image: node:14
script:
- npm ci
- npm run unit
coverage: /^All files[^|]*\|[^|]*\s+([\d\.]+)/
npm:
stage: publish
script:
- VERSION_TAG=$([[ $CI_COMMIT_TAG == *"-rc"* ]] && echo "next" || echo "latest")
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
- npm ci
- npm run prepare
- npm publish --tag $VERSION_TAG
environment:
name: npm
url: https://www.npmjs.com/package/${CI_PROJECT_NAME}
when: manual
only:
- /^v\d+\.\d+\.\d+(-rc.\d+|)$/