-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
318 lines (290 loc) · 9.69 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
image: debian:unstable
stages:
- prepare
- test
- build
- www
- distribution
variables:
INSTALL_DIR: "_install"
INSTALL_PREFIX: "${CI_PROJECT_DIR}/${INSTALL_DIR}"
build-image:
stage: prepare
variables:
GIT_STRATEGY: none
cache: {}
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- echo "FROM debian:unstable" > Dockerfile
- echo "RUN apt-get update" >> Dockerfile
- echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
- echo "automake build-essential docbook-website docbook-xml docbook-xsl fonts-noto-cjk fonts-noto-core gettext git intltool librsvg2-2 librsvg2-bin pkg-config pngcrush python3 python3-libxml2 python3-polib xsltproc libxml2-utils" >> Dockerfile
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-latest --cache=true --cache-ttl=120h
po-validate:
stage: test
image: $CI_REGISTRY_IMAGE:build-debian-latest
script:
- cd po
- find . -type f -print0 | xargs -0 ../tools/validate_po.py $1 $2
needs: ["build-image"]
check-broken-images:
stage: test
image: $CI_REGISTRY_IMAGE:build-debian-latest
script:
# We need a src/preface/authors.xml or validate_references will fail.
# Since it doesn't contain images, its real contents are not important.
- cat src/help-missing.xml > src/preface/authors.xml
- if ./tools/validate_references.py -b | grep 'BROKEN:'; then echo "ERROR missing images found!" && false; exit 2; fi;
needs: ["build-image"]
.build-debian-base:
stage: build
image: $CI_REGISTRY_IMAGE:build-debian-latest
artifacts:
expire_in: 1 week
when: always
paths:
- "${HELP_DIR}"
- "${PDF_DIR}"
- _log
script:
- cd src
# Mark all source files as updated. Needed to get up-to-date translations
- find . -type f -exec touch {} +
- cd ..
- mkdir _build
- cd _build
- ../autogen.sh --prefix=${INSTALL_PREFIX} --without-gimp
# Make po first to get validate to use up-to-date translations, and also to stop plain make from redoing the xml
- make po
- make validate-all
# Test if any xml is present in logs, which means failed validation
- if [ `ls -1 log/*.xml 2>/dev/null | wc -l ` -gt 0 ]; then mv log/ ../_log/; echo 'Validation failed!' && false; exit 2; else rm -f log/*.log; fi
- make && make install
- mv ${INSTALL_PREFIX}/share/gimp/3.0/help/ ../${HELP_DIR}
- mv ../${HELP_DIR}/pdf/ ../${PDF_DIR}
timeout: 2 hours 30 minutes
needs: ["build-image"]
# Due to libxml2 issues and Debian not having newer versions available,
# validate can fail. However, we still want at least those parts of the
# manual that were generated, so execute validate last
.build-debian-validate-last:
stage: build
image: $CI_REGISTRY_IMAGE:build-debian-latest
artifacts:
expire_in: 1 week
when: always
paths:
- "${HELP_DIR}"
- "${PDF_DIR}"
- _log
script:
- cd src
# Mark all source files as updated. Needed to get up-to-date translations
- find . -type f -exec touch {} +
- cd ..
- mkdir _build
- cd _build
- ../autogen.sh --prefix=${INSTALL_PREFIX} --without-gimp
# Make po first to get validate to use up-to-date translations, and also to stop plain make from redoing the xml
- make po
- make && make install
- mv ${INSTALL_PREFIX}/share/gimp/3.0/help/ ../${HELP_DIR}
- mv ../${HELP_DIR}/pdf/ ../${PDF_DIR}
# Validate last for known problematic languages
- make validate-all
# Test if any xml is present in logs, which means failed validation
- if [ `ls -1 log/*.xml 2>/dev/null | wc -l ` -gt 0 ]; then mv log/ ../_log/; echo 'Validation failed!' && false; exit 2; else rm -f log/*.log; fi
timeout: 2 hours 30 minutes
needs: ["build-image"]
build-debian-1:
extends: .build-debian-base
variables:
LINGUAS: "bg ca cs da de"
HELP_DIR: "_html1"
PDF_DIR: "_pdf1"
build-debian-2:
extends: .build-debian-base
variables:
LINGUAS: "en en_GB es fa fi fr"
HELP_DIR: "_html2"
PDF_DIR: "_pdf2"
build-debian-3:
extends: .build-debian-base
variables:
LINGUAS: "hr hu it ja ko lt"
HELP_DIR: "_html3"
PDF_DIR: "_pdf3"
build-debian-4:
extends: .build-debian-base
variables:
LINGUAS: "nl nn pl pt pt_BR ro"
HELP_DIR: "_html4"
PDF_DIR: "_pdf4"
build-debian-5:
extends: .build-debian-base
variables:
LINGUAS: "ru sl sv tr uk zh_CN"
HELP_DIR: "_html5"
PDF_DIR: "_pdf5"
build-debian-6:
extends: .build-debian-validate-last
variables:
LINGUAS: "el"
HELP_DIR: "_html6"
PDF_DIR: "_pdf6"
allow_failure: true
www-debian:
stage: www
variables:
BUILD_DIR: "."
image: $CI_REGISTRY_IMAGE:build-debian-latest
dependencies:
- build-debian-1
- build-debian-2
- build-debian-3
- build-debian-4
- build-debian-5
- build-debian-6
artifacts:
expire_in: 1 week
when: always
paths:
- build/windows/installer/lang/
- htdocs/
script:
# build the installer language files only.
- mkdir _build
- cd _build
- ../autogen.sh --prefix=${INSTALL_PREFIX} --without-gimp --enable-windows-installer
- cd build/windows/installer/lang
- make
- cd ../../../..
- mv build/windows/installer/lang/help*isl ../build/windows/installer/lang/
# Mark all source files as updated. Needed to get up-to-date translation percentages
- cd ../src
- find . -type f -exec touch {} +
# update the po files or translation percentages will be incorrect
- cd ../_build
- make po
# build the landing pages.
- cd ../web
- make
- cd ..
- mv web/html/ htdocs/
# Move all PDF quickreferences
- MAJOR_VERSION=`grep 'm4_define(\[help_major_version' configure.ac |sed 's/m4_define(\[help_major_version.*\[\([0-9]*\)\].*/\1/'`
- MINOR_VERSION=`grep 'm4_define(\[help_minor_version' configure.ac |sed 's/m4_define(\[help_minor_version.*\[\([0-9]*\)\].*/\1/'`
- mkdir -p htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf
- mv _pdf1/*.pdf htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf/
- mv _pdf2/*.pdf htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf/
- mv _pdf3/*.pdf htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf/
- mv _pdf4/*.pdf htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf/
- mv _pdf5/*.pdf htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf/
- mv _pdf6/*.pdf htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/pdf/
# Move all the help html files.
- mv _html1/* htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/
- mv _html2/* htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/
- mv _html3/* htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/
- mv _html4/* htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/
- mv _html5/* htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/
- mv _html6/* htdocs/${MAJOR_VERSION}.${MINOR_VERSION}/
win-installer:
variables:
CHERE_INVOKING: "yes"
tags:
- win32-ps
stage: distribution
dependencies:
- www-debian
artifacts:
name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
when: always
expire_in: 1 week
paths:
- build/windows/installer/_Output
- installer.log
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/installer/installer-gimp-help-msys2.sh > installer.log 2>&1"
.distcheck-base:
rules:
# On releases.
- if: '$CI_COMMIT_TAG != null'
# Custom builds though web GUI, API or schedules.
- if: '$GIMP_HELP_CI_MAKE_DIST != null'
# Merge requests with appropriate label.
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Source Distribution.*/'
stage: test
image: $CI_REGISTRY_IMAGE:build-debian-latest
script:
- cd src
# Mark all source files as updated. Needed to get up-to-date translations
- find . -type f -exec touch {} +
- cd ..
- mkdir _build
- cd _build
- ../autogen.sh --prefix=${INSTALL_PREFIX} --without-gimp
- make distcheck
needs: ["build-image"]
# One make distcheck would be ideal, but the reality is that on certain runners
# we don't finish within the 1 hour timeout. Let's split it into several jobs.
distcheck-1:
extends: .distcheck-base
variables:
LINGUAS: "bg ca cs da de"
distcheck-2:
extends: .distcheck-base
variables:
LINGUAS: "en en_GB es fa fi fr"
distcheck-3:
extends: .distcheck-base
variables:
LINGUAS: "hr hu it ja ko lt"
distcheck-4:
extends: .distcheck-base
variables:
LINGUAS: "nl nn pl pt pt_BR ro"
distcheck-5:
extends: .distcheck-base
variables:
LINGUAS: "ru sl sv tr uk zh_CN"
distcheck-6:
extends: .distcheck-base
variables:
LINGUAS: "el"
allow_failure: true
source-dist:
rules:
# On releases.
- if: '$CI_COMMIT_TAG != null'
# Custom builds though web GUI, API or schedules.
- if: '$GIMP_HELP_CI_MAKE_DIST != null'
# Merge requests with appropriate label.
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Source Distribution.*/'
stage: distribution
image: $CI_REGISTRY_IMAGE:build-debian-latest
artifacts:
expire_in: 1 week
when: always
paths:
#- _build
- _dist
script:
- cd src
# Mark all source files as updated. Needed to get up-to-date translations
- find . -type f -exec touch {} +
- cd ..
- mkdir _dist
- mkdir _build
- cd _build
- ../autogen.sh --prefix=${INSTALL_PREFIX} --without-gimp
- make dist
- FILENAME=`ls gimp-help-*.tar.bz2` &&
sha256sum gimp-help-*.tar.bz2 > ../_dist/${FILENAME}.SHA256SUMS &&
sha512sum gimp-help-*.tar.bz2 > ../_dist/${FILENAME}.SHA512SUMS
- mv gimp-help-*.tar.bz2 ../_dist/
needs: ["build-image"]