File tree 2 files changed +72
-3
lines changed
2 files changed +72
-3
lines changed Original file line number Diff line number Diff line change
1
+ image : node:12
2
+
3
+ # ===========================================================
4
+ # global variables
5
+ # ===========================================================
6
+
7
+ variables :
8
+ CACHE_DIR : .npm
9
+ npm_config_cache : $CI_PROJECT_DIR/$CACHE_DIR
10
+ INFINITY_VERSION_PRERELEASE_SEPARATOR : " -"
11
+
12
+ stages :
13
+ - build
14
+ - publish
15
+
16
+
17
+ # ===========================================================
18
+ # global job configuration and templates
19
+ # ===========================================================
20
+
21
+ # output build info in each job
22
+ before_script :
23
+ - infinity config build-info
24
+
25
+
26
+ # for the cache we can rely on the package-lock.json file hash - if it changed, we use a new cache
27
+ # a cache template to use push strategy for updating the cache
28
+ .setup_cache : &setup_cache
29
+ cache :
30
+ key :
31
+ files :
32
+ - package-lock.json
33
+ paths :
34
+ - $CACHE_DIR
35
+ policy : push
36
+
37
+
38
+ # a cache template to use pull strategy to just use the cache
39
+ .use_cache : &use_cache
40
+ cache :
41
+ key :
42
+ files :
43
+ - package-lock.json
44
+ paths :
45
+ - $CACHE_DIR
46
+ policy : pull
47
+
48
+
49
+ # a template for installing dependencies faster
50
+ .install_deps : &install_deps
51
+ - npm ci --cache $CACHE_DIR --prefer-offline --no-audit --verbose
52
+
53
+
54
+ build :
55
+ stage : build
56
+ << : *setup_cache
57
+ script :
58
+ - *install_deps
59
+ - npm run publish:prepare
60
+ - cd dist && npm version --no-git-tag-version --allow-same-version $(infinity version get)
61
+ artifacts :
62
+ paths :
63
+ - dist
64
+
65
+
66
+ internal-publish :
67
+ stage : publish
68
+ dependencies :
69
+ - build
70
+ script :
71
+ - npm config set registry $NEXUS3_NPM_REGISTRY
72
+ - infinity npm publish dist/
Original file line number Diff line number Diff line change 41
41
"ajv" : " ^6.1.1" ,
42
42
"js-yaml" : " ^3.10.0"
43
43
},
44
- "publishConfig" : {
45
- "registry" : " https://registry.npmjs.org/"
46
- },
47
44
"devDependencies" : {
48
45
"@types/chai" : " ^4.1.2" ,
49
46
"@types/chai-as-promised" : " ^7.1.0" ,
You can’t perform that action at this time.
0 commit comments