-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
152 lines (139 loc) · 3.62 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
stages:
- build
- deploy
- release
variables:
GRADLE_OPTS: "-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false"
PRODUCT: Writerside/pd
ARTIFACT: webHelpPD2-all.zip
WRS_VERSION: "242.21870"
image: registry.gitlab.com/pablomxnl/vale-cli-plugin/builder:0.0.19
default:
tags:
- pluginbuilder
cache:
key: ${CI_PROJECT_NAME}
paths:
- .gradle
.build_release:
stage: build
coverage: '/ - Instruction Coverage: ([0-9.]+)%/'
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: '$CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/'
artifacts:
when: always
paths:
- build/distributions/*.zip
- build/reports/tests
- build/reports/jacoco/test
reports:
junit: build/test-results/test/**/TEST-*.xml
expire_in: 360 days
.build_artifact:
stage: build
coverage: '/ - Instruction Coverage: ([0-9.]+)%/'
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
artifacts:
when: always
paths:
- build/distributions/*.zip
- build/reports/tests
- build/reports/jacoco/test
reports:
junit: build/test-results/test/**/TEST-*.xml
expire_in: 7 days
build_artifact:
extends: .build_artifact
script:
- gradle -Dversion.prerelease=$CI_PIPELINE_ID-SNAPSHOT build
- gradle buildPlugin
build_release_artifact:
extends: .build_release
script:
- gradle build
- gradle buildPlugin
build-documentation:
image: "registry.jetbrains.team/p/writerside/builder/writerside-builder:$WRS_VERSION"
stage: build
variables:
GIT_DEPTH: 0
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- set -e
- export DISPLAY=:99
- Xvfb :99 &
- /opt/builder/bin/idea.sh helpbuilderinspect -source-dir . -product $PRODUCT --runner gitlab -output-dir public/
- echo "Test existing of $ARTIFACT artifact"
- test -e public/$ARTIFACT
artifacts:
paths:
- public/$ARTIFACT
pages:
stage: deploy
image: alpine:latest
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
- apk add zip
script:
- cp -R build/reports/jacoco/test public/
- mv public/test public/coverage
- cp -R build/reports/tests/test public/
- mv public/test public/testreport
- cd public
- unzip $ARTIFACT
artifacts:
paths:
- public
prepare_release_notes:
stage: build
image: docker.io/library/node:lts-alpine
rules:
- if: '$CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/'
script:
- npm i -g downdoc
- downdoc CHANGELOG.adoc
- awk '/^### /{if(x)exit;x=1}x' CHANGELOG.md > release_notes.md
artifacts:
paths:
- release_notes.md
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare_release_notes
artifacts: true
- job: build_release_artifact
artifacts: true
rules:
- if: '$CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/'
script:
- echo "Creating release"
release:
name: 'Release $CI_COMMIT_TAG'
description: release_notes.md
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
assets:
links:
- name: "Vale CLI Plugin v$CI_COMMIT_TAG for Jetbrain's IDEs"
url: "$CI_SERVER_URL/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/file/build/distributions/vale-cli-plugin-$CI_COMMIT_TAG.zip"
artifacts:
when: always
paths:
- build/distributions/*.zip
upload_marketplace:
stage: release
rules:
- if: '$CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/'
needs:
- job: build_release_artifact
artifacts: true
- job: release_job
artifacts: false
script:
- gradle publishPlugin