-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
36 lines (35 loc) · 1.16 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
stages:
- package-release
package-release:
image: node:12.17.0
stage: package-release
before_script:
- git remote set-url origin https://gitlab-ci-token:$CI_PUSH_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git
- git config --global user.email '[email protected]'
- git config --global user.name 'gitlab-ci'
- |
{
echo "registry=https://registry.npmjs.org/"
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
} | tee --append .npmrc
script:
- node "./ci.js" $CI_COMMIT_TAG
- npm ci
- npm run build
- npm publish --access public
after_script:
- git checkout -B master
- git add package.json
- git commit -m '[gitlab-ci] Published Version'
- git push "https://gitlab-ci-token:$CI_PUSH_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git"
- git tag -d $CI_COMMIT_TAG
- git tag $CI_COMMIT_TAG
- git push "https://gitlab-ci-token:$CI_PUSH_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git" --tags --force
rules:
- if: '$CI_COMMIT_TITLE == "[gitlab-ci] Published Version"'
when: never
- if: '$CI_COMMIT_TAG =~ /^release-/'
when: always
- when: never
tags:
- gitlab-org