-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
52 lines (45 loc) · 1.05 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
stages:
- test
- prep
- build
- publish
image: node:12
# Validate that the repository contains a package.json and extract a few values from it.
before_script:
- source bin/validate-package-json.sh
# Validate that the package name is properly scoped to the project's root namespace.
# For more information, see https://docs.gitlab.com/ee/user/packages/npm_registry/#package-naming-convention
validate_package_scope:
stage: prep
script:
- source bin/validate-package-scope.sh
# If no .npmrc if included in the repo, generate a temporary one to use during the publish step
# that is configured to publish to GitLab's NPM registry
create_npmrc:
stage: prep
script:
- source bin/create-npmrc.sh
artifacts:
paths:
- .npmrc
unit_tests:
stage: test
script:
- npm ci
- npm run test:once
build:
stage: build
only:
- branches
script:
- npm ci
- npm run build
publish:
stage: publish
only:
- master
script:
- source bin/override-envs.sh
- npm ci
- npm run build
- npx semantic-release