-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy path.gitlab-ci.yml
155 lines (143 loc) · 3.22 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
image: node:18-alpine
stages:
- build
- integration
- test
- review
- deploy
build-lib:
stage: build
script:
- npm ci
- npm run build:lib
artifacts:
expire_in: 1 week
paths:
- dist/@w11k/angular-sticky-things
tags:
- docker
- linux
build-demo-master:
stage: integration
script:
- npm ci
- npm run build -- --base-href "/angular-sticky-things/"
artifacts:
expire_in: 1 week
paths:
- dist/angular-sticky-things-demo
only:
- master
tags:
- docker
- linux
build-demo-review:
stage: integration
script:
- npm ci
- npm run build -- --base-href /angular-sticky-things/review/$CI_COMMIT_REF_NAME/index.html
artifacts:
expire_in: 1 week
paths:
- dist/angular-sticky-things-demo
only:
- develop
tags:
- docker
- linux
test-lib:
image: trion/ng-cli-karma
stage: test
script:
- npm ci
- npm run test:lib
tags:
- docker
- linux
#test-demo:
# image: trion/ng-cli-karma
# stage: test
# script:
# - npm run test
#
#test-demo:
# image: trion/ng-cli-karma
# stage: test
# script:
# - npm ci
# - npm run e2e
# tags:
# - docker
# - linux
#publish-review:
# stage: review
# before_script:
# - npm install npx -g
# - apk update && apk add git
# script:
# - git config --global user.email "[email protected]"
# - git config --global user.name "W11K Deploy"
# - npx gh-pages -e review/$CI_COMMIT_REF_NAME -d dist/angular-sticky-things-demo --repo https://[email protected]/w11k/angular-sticky-things
# environment:
# name: review/$CI_COMMIT_REF_NAME
# url: https://w11k.github.io/angular-sticky-things/review/$CI_COMMIT_REF_NAME
# only:
# - branches
# except:
# - master
# tags:
# - docker
# - linux
#publish-master:
# stage: review
# before_script:
# - npm install npx -g
# - apk update && apk add git
# script:
# - git config --global user.email "[email protected]"
# - git config --global user.name "W11K Deploy"
# - npx gh-pages -d dist/angular-sticky-things-demo --remote https://[email protected]/w11k/angular-sticky-things --add
# environment:
# name: production
# url: https://w11k.github.io/angular-sticky-things/
# only:
# - master
# tags:
# - docker
# - linux
#publish-dev:
# stage: deploy
# only:
# - tags
# before_script:
# - apk update && apk add git
# - export COMMIT_TIME=$(git show -s --format=%ct $CI_COMMIT_SHA)
# - export PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)
# - export DEV_VERSION="$PACKAGE_VERSION-dev-$COMMIT_TIME"
# script:
# - npm version DEV_VERSION
# - cd dist/@w11k/angular-sticky-things
# - cp ../../../README.md .
# - cp ../../../LICENSE .
# - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
# - npm publish --access=public --tag next
# tags:
# - docker
# - linux
publish:
stage: deploy
only:
- tags
script:
- rm -rf node_modules
- rm -rf dist
- npm ci
- npm run build:lib
- cd dist/@w11k/angular-sticky-things
- cp ../../../README.md .
- cp ../../../LICENSE .
- echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc
- npm publish --access=public
tags:
- docker
- linux