forked from signalfx/splunk-otel-js-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
92 lines (78 loc) · 1.66 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
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
default:
image: 'cimg/node:current-browsers'
cache:
key:
files:
- package-lock.json
paths:
- "./node_modules"
stages:
- setup
- build
- test
- release
npm_install:
stage: setup
script:
- npm ci --include=dev
check_version:
stage: build
script:
- npm run version:check
check_tag:
stage: build
only:
- /^v.*/
script:
- npm run tag:check
lint:
stage: build
script:
- npm run lint
- npm run lint:markdown
build:
stage: build
only:
- /^[^v].*/
artifacts:
paths:
- dist/
script:
- npm run compile
build_artifacts:
stage: build
only:
- /^v[0-9]+\..*/
artifacts:
paths:
- dist/artifacts/
script:
- npm run compile
- npm pack
# complete artifacts & checksums
- mv splunk-otel-web-${CI_COMMIT_REF_NAME:1}.tgz dist/artifacts/
- shasum -a 256 dist/artifacts/* > dist/artifacts/checksums.txt
unit_test:
stage: test
script:
- npm run test:unit:ci
release_production:
artifacts:
paths:
- dist/artifacts/
stage: release
only:
- /^v[0-9]+\..*/
script:
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
- sudo apt-add-repository https://cli.github.com/packages
- sudo apt update
- sudo apt install gh
# release to NPM
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
- npm publish ./dist/artifacts/splunk-otel-web-${CI_COMMIT_REF_NAME:1}.tgz
- rm -f ~/.npmrc
# release in Github
- gh release create v${CI_COMMIT_REF_NAME:1} ./dist/artifacts/* --target $CI_COMMIT_SHA --repo $GITHUB_REPOSITORY
# release to CDN
- node scripts/release-cdn.mjs