-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
54 lines (46 loc) · 1.43 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
image: node:16-alpine
cache:
paths:
- node_modules
stages:
- test
- publish
test:
script:
- apk add --update --no-cache chromium-chromedriver chromium
- yarn install --frozen-lockfile
- yarn test --browsers=ChromiumCI --progress false --watch=false
.publish_job: &publish_job
stage: publish
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED
publish_packages:
<<: *publish_job
script:
# Install deps
- yarn install --frozen-lockfile
- PATH="$(pwd)/node_modules/.bin:${PATH}"
# Build package
- cd "${CI_PROJECT_DIR}/projects/${PKG_NAME}/"
- yarn install --frozen-lockfile
- ng build "$PKG_NAME"
# Publish to Gitlab's package registry
- cd "${CI_PROJECT_DIR}/dist/${PKG_NAME}"
- echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrc
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
- npm publish
parallel:
matrix:
- PKG_NAME: ng-filterable-grid
- PKG_NAME: ng-shopify-cart
- PKG_NAME: ng-yotpo
publish_gitlab_release:
<<: *publish_job
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo 'release job'
release:
name: 'Release $CI_COMMIT_TAG'
description: 'Release $CI_COMMIT_TAG. Tagged by $GITLAB_USER_LOGIN'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_TAG'