-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
82 lines (66 loc) · 1.28 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
image: node:10
variables:
APP: 'angular-shell-schematic'
cache:
paths:
- node_modules
before_script:
- node -v
- npm -v
- yarn -v
- which node
- which npm
- which yarn
- yarn --non-interactive
stages:
- build
- test
- deploy
# Build
.build:
stage: build
script:
- yarn build
build-node-10:
image: node:10
extends: .build
build-node-11:
image: node:11
extends: .build
build-node-12:
image: node:12
extends: .build
# Test
.test:
stage: test
script:
- yarn test
test-node-10:
image: node:10
extends: .test
test-node-11:
image: node:11
extends: .test
test-node-12:
image: node:12
extends: .test
# Deploy
publish:
stage: deploy
only:
variables:
- $NEW_VERSION
environment:
name: production
url: https://www.npmjs.com/package/angular-shell-schematic
before_script:
- git config user.email "$GITLAB_USER_EMAIL"
- git config user.name "$GITLAB_USER_NAME"
- git remote set-url origin https://jdat:${PERSONAL_ACCESS_TOKEN}@gitlab.com/jeandat/tools/angular-shell-schematic.git
script:
- yarn version --new-version=$NEW_VERSION
- git push origin HEAD:master
- git push origin --tags
- yarn build
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- yarn publish