forked from signageos/smil-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
executable file
·125 lines (112 loc) · 2.42 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
image: $CI_REGISTRY/signageos/docker-node:12.16.1-alpine-build
services:
- docker:dind
stages:
- prepare
- test
- build
- publish
- release
cache:
untracked: true
key: "$CI_PROJECT_ID"
paths:
- node_modules/
before_script:
- export VERSION=`cat ./VERSION`
- export TAG=$([ "$CI_COMMIT_TAG" == "" ] && echo $CI_COMMIT_REF_NAME || echo $(echo ${VERSION}-latest | sed -E 's/^[0-9].[0-9].[0-9]-([a-zA-Z0-9]+)(\.[0-9]+)?(-[a-zA-Z0-9]+)?$/\1/p' | tail -n1))
- npx --userconfig ./.npmrc @signageos/lib version-upgrade $VERSION
- mkdir -p dist
- npm install
prepare:
image: $CI_REGISTRY/signageos/docker:master
stage: prepare
before_script: []
script:
- ci-prepare
artifacts:
when: on_success
paths:
- ./VERSION
test:general:
stage: test
except:
- tags
script:
- npm test
test:lint:
stage: test
except:
- tags
script:
- npm run lint
test:changelog:
image: $CI_REGISTRY/signageos/docker:master
stage: test
except:
- tags
allow_failure: true
script:
- ci-test-changelog
test:check:
stage: test
except:
- tags
allow_failure: true
script:
- npm run check
build:
stage: build
dependencies:
- prepare
script:
- npm run prepare --production
- npm run escheck
artifacts:
when: on_success
paths:
- dist/
publish:npm:
stage: publish
dependencies:
- prepare
- build
script:
- echo 'registry=${NPM_REGISTRY_URL}' > .npmrc
- echo 'always-auth=true' >> .npmrc
- echo '//${NPM_REGISTRY_HOST}/:_authToken="${NPM_AUTH_TOKEN}"' >> .npmrc
- npm publish --ignore-scripts
publish:npm-public:
stage: publish
only:
- tags
- master
dependencies:
- prepare
- build
script:
- echo 'registry=${NPM_REGISTRY_URL}' > .npmrc
- echo 'always-auth=true' >> .npmrc
- echo '//${NPM_REGISTRY_HOST}/:_authToken="${NPM_AUTH_TOKEN}"' >> .npmrc
- export NPM_REGISTRY_URL=https://registry.npmjs.org/
- export NPM_REGISTRY_HOST=registry.npmjs.org
- export NPM_AUTH_TOKEN=$PUBLIC_NPM_AUTH_TOKEN
- tools/prepare-npm-public.js
- npm publish --ignore-scripts
release:tag:
image: $CI_REGISTRY/signageos/docker:master
stage: release
only:
- master
when: manual
allow_failure: false
before_script: []
script:
- ci-release-tag
release:notes:
image: $CI_REGISTRY/signageos/docker:master
stage: release
only:
- tags
script:
- ci-release-notes