-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
59 lines (54 loc) · 1.34 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
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
include:
- template: Jobs/Dependency-Scanning.latest.gitlab-ci.yml
- template: Jobs/License-Scanning.latest.gitlab-ci.yml
- template: Jobs/SAST.latest.gitlab-ci.yml
- template: Jobs/Secret-Detection.latest.gitlab-ci.yml
stages:
- build
- test
- publish
build:
image: node:16
stage: build
script:
- npm install
- npm run build
- npm pack
artifacts:
untracked: false
when: on_success
expire_in: 30 days
paths:
- peerplaysjs-lib-*.tgz
deploy:
image: node:16
stage: publish
script:
- echo "//registry.npmjs.org/:_authToken='$NPM_TOKEN'" > .npmrc
- npm publish $(ls | grep peerplaysjs-lib-*.tgz)
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: manual
dependencies: [build]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
sonarcloud-check:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner
only:
- branches
- merge_requests