Skip to content

Commit a771fae

Browse files
author
Milos Danilov
committed
Merge branch 'feat/gitlab-pipeline' into 'master'
CI / Add basic gitlab config with internal releases to Nexus3 See merge request rabix/cwl-ts!2
2 parents 1f21468 + 053394e commit a771fae

File tree

2 files changed

+72
-3
lines changed

2 files changed

+72
-3
lines changed

.gitlab-ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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/

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
"ajv": "^6.1.1",
4242
"js-yaml": "^3.10.0"
4343
},
44-
"publishConfig": {
45-
"registry": "https://registry.npmjs.org/"
46-
},
4744
"devDependencies": {
4845
"@types/chai": "^4.1.2",
4946
"@types/chai-as-promised": "^7.1.0",

0 commit comments

Comments
 (0)