-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·101 lines (93 loc) · 2 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
stages:
- prepare
- lint
- build
- publish
include:
# Prepare
- project: 'intern/runner-templates'
ref: "15.3"
file: '/yarn/install-js-dependencies.yml'
# Lint
- project: 'intern/runner-templates'
ref: "15.3"
file: '/ts/tslint.yml'
# Build
- project: 'intern/runner-templates'
ref: "15.3"
file: '/yarn/build-prod.yml'
install-js-dependencies:
except:
- schedules
- master
ts-analysis:
except:
- schedules
- tags
- master
build-assets:
needs:
- install-js-dependencies
artifacts:
when: on_failure
untracked: true
except:
- schedules
- tags
- master
publish-pkg:
stage: publish
image: node:20-alpine
resource_group: $CI_JOB_NAME
needs:
- install-js-dependencies
cache:
key:
files:
- yarn.lock
prefix: ${CI_PROJECT_PATH_SLUG}_yarn
paths:
- node_modules/
policy: pull
script:
- echo "username=${NPM_USER}" > .npmrc
- echo "_password=$(echo -n ${NPM_PASS} | base64)" >> .npmrc
- echo "email=${NPM_EMAIL}" >> .npmrc
- echo "always-auth=true" >> .npmrc
- yarn version --new-version ${CI_COMMIT_TAG} --no-git-tag-version
- yarn publish
after_script:
- rm .npmrc
tags:
- docker
only:
- tags
publish-pkg-npmjs:
stage: publish
image: node:20-alpine
resource_group: ${CI_JOB_NAME}_npmjs
needs:
- install-js-dependencies
cache:
key:
files:
- yarn.lock
prefix: ${CI_PROJECT_PATH_SLUG}_yarn
paths:
- node_modules/
policy: pull
script:
- echo "username=${NPMJS_USER}" >> .npmrc
- echo "email=${NPMJS_EMAIL}" >> .npmrc
- echo "always-auth=true" >> .npmrc
- echo "//${NPMJS_REGISTRY}/:_authToken=${NPMJS_TOKEN}" >> .npmrc
- echo "registry \"https://${NPMJS_REGISTRY}\"" >> .yarnrc
- yarn version --new-version ${CI_COMMIT_TAG} --no-git-tag-version
- yarn publish --access public
after_script:
- rm .npmrc
- git checkout .yarnrc
tags:
- docker
only:
- tags