-
Notifications
You must be signed in to change notification settings - Fork 13
/
.gitlab-ci.yml
49 lines (43 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
40
41
42
43
44
45
46
47
48
49
default:
image: 'cimg/node:lts'
include:
- project: 'ci-cd/templates'
ref: master
file: '/prodsec/.oss-scan.yml'
stages:
- scan
- release
.prepare_dist: &prepare_dist
- npm install
- npm run prepare-release-artifact
- shasum -a 256 dist/* > dist/checksums.txt
oss-scan:
stage: scan
extends: .oss-scan
release:
stage: release
artifacts:
paths:
- dist/
rules:
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*/
script:
- *prepare_dist
- npm run release:github
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm publish ./dist/splunk-otel-${CI_COMMIT_REF_NAME:1}.tgz
- rm -f ~/.npmrc
when: manual
prerelease:
stage: release
artifacts:
paths:
- dist/
rules:
- if: $CI_COMMIT_TAG =~ /^prerelease-v[0-9]+\.[0-9]+\.[0-9]+(?:-.+)?$/
script:
- *prepare_dist
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm publish --tag prerelease ./dist/splunk-otel-${CI_COMMIT_REF_NAME:12}.tgz
- rm -f ~/.npmrc
when: manual