-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
99 lines (88 loc) · 1.74 KB
/
.gitlab-ci.yml
File metadata and controls
99 lines (88 loc) · 1.74 KB
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
default:
image: 'cimg/node:20.18.0'
cache:
key:
files:
- package-lock.json
paths:
- './node_modules'
include:
- project: 'ci-cd/templates'
ref: master
file: '/prodsec/.oss-scan.yml'
- project: 'ci-cd/templates'
ref: master
file: '/prodsec/.sast-scan.yml'
stages:
- install
- build
- lint
- test
- verify
- release
install_dependencies:
stage: install
script:
- npm ci
build:
stage: build
script:
- npm run build
artifacts:
paths:
- dist/
lint:
stage: lint
script:
- npm run lint
unit_tests:
stage: test
script:
- npm run test:unit
oss-scan:
stage: verify
extends: .oss-scan
sast-scanner:
stage: verify
extends: .sast_scan
variables:
alert_mode: "policy"
release_dry_run:
stage: release
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm publish --dry-run
- rm -f ~/.npmrc
dependencies:
- build
- lint
- unit_tests
when: manual
pre_release:
stage: release
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm publish --tag prerelease
- rm -f ~/.npmrc
rules:
# Only run the pre release step for Git tags (e.g., prerelease-v1.2.3, prerelease-v1.2.3-alpha etc)
- if: $CI_COMMIT_TAG =~ /^prerelease-v[0-9]+\.[0-9]+\.[0-9]+(?:-.+)?$/
dependencies:
- build
- lint
- unit_tests
when: manual
release:
stage: release
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm publish
- rm -f ~/.npmrc
rules:
# Only run the release step for Git tags (e.g., v1.0.0)
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*/
dependencies:
- build
- lint
- unit_tests
when: manual