-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
39 lines (35 loc) · 1.03 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
image: node:12-alpine
variables:
DEPLOY_TOKEN: ${CI_JOB_TOKEN}
stages:
- build
- publish
build:
stage: build
script:
- apk add python make g++
- echo '//gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}'>.npmrc
- npm config set @wnm.development:registry https://gitlab.com/api/v4/packages/npm/
- npm config set '//gitlab.com/api/v4/packages/npm/:_authToken' "${DEPLOY_TOKEN}"
- npm install
- npm run build
cache:
paths:
- node_modules
artifacts:
paths:
- dist/
- node_modules
publish:
allow_failure: true
only:
- master
needs: [ "build" ]
stage: publish
script:
- apk add jq
- export TAG=$(cat package.json | jq -r .tag)
- echo '//gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}'>.npmrc
- npm config set @wnm.development:registry https://gitlab.com/api/v4/packages/npm/
- npm config set '//gitlab.com/api/v4/packages/npm/:_authToken' "${DEPLOY_TOKEN}"
- npm publish --tag=$TAG