.gitlab-ci.yml 24.8 KB
Newer Older
Jehan's avatar
Jehan committed
1
# Default commit CI should only run the following pipelines:
2
# - Linux autotools and meson (base & fast)
Jehan's avatar
Jehan committed
3 4
# - Win64 crossbuild (base & fast)
# Scheduled CI ($CI_PIPELINE_SOURCE == "schedule") will run regularly:
5 6 7
# - Win 32/64 native builds (base but slow)
# - Win32 crossbuilds (rare usefulness)
# - Linux CLang (rare usefulness)
Jehan's avatar
Jehan committed
8 9
# - cppcheck (static code analysis)
# Releases ($CI_COMMIT_TAG != null) should run only:
10
# - Linux autotools (distcheck source tarball)
Jehan's avatar
Jehan committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24
# - Win 32/64 native builds (Windows installer creation)
#
# To force step-specific pipelines without waiting for commits and/or
# pipelines, these are the variable you should set:
# - GIMP_CI_AUTOTOOLS: trigger the autotools/gcc build.
# - GIMP_CI_MESON_GCC: trigger the meson/gcc build.
# - GIMP_CI_MESON_CLANG: trigger the meson/clang build.
# - GIMP_CI_CROSSROAD_WIN32: trigger the crossroad/meson build for Win 32-bit.
# - GIMP_CI_CROSSROAD_WIN64: trigger the crossroad/meson build for Win 64-bit.
# - GIMP_CI_MSYS2_WIN32: trigger the native MSYS2 build for Win 32-bit.
# - GIMP_CI_MSYS2_WIN64: trigger the native MSYS2 build for Win 64-bit.
# - GIMP_CI_WIN_INSTALLER: trigger both native MSYS2 builds then creates Windows installer.
# - GIMP_CI_SOURCES: trigger the autotools/gcc build and the source tarball job.
# - GIMP_CI_CPPCHECK: trigger cppcheck static analysis.
25

26
image: debian:testing
Salamandar's avatar
Salamandar committed
27

28
stages:
29
  - prepare
Jehan's avatar
Jehan committed
30
  - dependencies
31
  - gimp
32
  - analysis
Jehan's avatar
Jehan committed
33
  - distribution
34 35

variables:
Jehan's avatar
Jehan committed
36
  GIT_DEPTH: "1"
37
  INSTALL_DIR: "_install"
Salamandar's avatar
Salamandar committed
38
  INSTALL_PREFIX: "${CI_PROJECT_DIR}/${INSTALL_DIR}"
39
  APT_CACHE: "${CI_PROJECT_DIR}/apt-cache"
40

41 42 43
## prepare docker images ##

build-image:
44
  rules:
Jehan's avatar
Jehan committed
45 46 47 48 49 50 51 52 53
    # On commits.
    - if: '$CI_PIPELINE_SOURCE == "push"'
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_AUTOTOOLS != null'
    - if: '$GIMP_CI_SOURCES != null'
    - if: '$GIMP_CI_MESON_GCC != null'
    - if: '$GIMP_CI_MESON_CLANG != null'
54 55 56 57 58 59 60 61 62 63 64 65 66
  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:testing" > Dockerfile
    - echo "RUN apt-get update" >> Dockerfile
    - echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
67
    - echo "at-spi2-core build-essential desktop-file-utils ffmpeg ghostscript git glib-networking gobject-introspection graphviz graphviz-dev gtk-doc-tools hicolor-icon-theme intltool iso-codes libappstream-glib-dev libbz2-dev libdbus-glib-1-dev libexif-dev libgexiv2-dev libgirepository1.0-dev libgtk-3-bin libgtk-3-dev libgudev-1.0-dev libjson-glib-dev liblcms2-dev liblzma-dev libmng-dev libmypaint-dev libopenexr-dev libpoppler-glib-dev libraw-dev libraw20 librsvg2-dev libspiro-dev libsuitesparse-dev libtiff-dev libtiff5-dev libtool libumfpack5 libwebp-dev libwmf-dev libxmu-dev libxpm-dev luajit meson mypaint-brushes poppler-data python3 valac xauth xvfb" >> Dockerfile
68 69 70 71 72

    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-latest --cache=true --cache-ttl=120h


build-image-win64:
73
  rules:
Jehan's avatar
Jehan committed
74 75 76 77
    # On commits except tags.
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG == null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_CROSSROAD_WIN64 != null'
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
  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:testing" > Dockerfile
    - echo "RUN apt-get update" >> Dockerfile
    - echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
    - echo "build-essential cpio g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 git intltool libgdk-pixbuf2.0-dev libglib2.0-bin meson pkg-config python3 python3-distutils python3-docutils python3-pip rpm xsltproc" >> Dockerfile

    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-win64-latest --cache=true --cache-ttl=120h


build-image-win32:
97
  rules:
Jehan's avatar
Jehan committed
98 99
    # Custom builds only (web GUI, API or schedules).
    - if: '$GIMP_CI_CROSSROAD_WIN32 != null'
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
  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:testing" > Dockerfile
    - echo "RUN apt-get update" >> Dockerfile
    - echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
    - echo "build-essential cpio g++-mingw-w64-i686 gcc-mingw-w64-i686 git intltool libgdk-pixbuf2.0-dev libglib2.0-bin meson pkg-config python3 python3-distutils python3-docutils python3-pip rpm xsltproc" >> Dockerfile

    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-win32-latest --cache=true --cache-ttl=120h


Jehan's avatar
Jehan committed
118
## GNU/Linux 64-bit CIs (Debian testing) ##
Jehan's avatar
Jehan committed
119

Jehan's avatar
Jehan committed
120
deps-debian:
121
  rules:
Jehan's avatar
Jehan committed
122 123 124 125 126 127 128 129 130
    # On commits.
    - if: '$CI_PIPELINE_SOURCE == "push"'
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_AUTOTOOLS != null'
    - if: '$GIMP_CI_SOURCES != null'
    - if: '$GIMP_CI_MESON_GCC != null'
    - if: '$GIMP_CI_MESON_CLANG != null'
Jehan's avatar
Jehan committed
131
  stage: dependencies
132
  image: $CI_REGISTRY_IMAGE:build-debian-latest
Jehan's avatar
Jehan committed
133
  cache:
134
    paths:
135
    - apt-cache
136
  artifacts:
137
    expire_in: 2 hours
Jehan's avatar
Jehan committed
138
    when: always
139
    paths:
Salamandar's avatar
Salamandar committed
140
    - "${INSTALL_DIR}"
Jehan's avatar
Jehan committed
141
    - _babl/_build
Jehan's avatar
Jehan committed
142
    - _gegl/_build
143
  before_script:
144
    - git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git _babl
Salamandar's avatar
Salamandar committed
145
    - git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl
146 147 148 149 150
    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig"
    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/`gcc -print-multiarch`/pkgconfig/:$PKG_CONFIG_PATH"
    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib/`gcc -print-multiarch`:$LD_LIBRARY_PATH"
    - export XDG_DATA_DIRS="${INSTALL_PREFIX}/share:/usr/local/share:/usr/share"
151
  script:
Jehan's avatar
Jehan committed
152 153 154 155 156
    - cd _babl
    - meson -Dprefix="${INSTALL_PREFIX}" _build
    - ninja -C _build
    - ninja -C _build install
    - cd ../_gegl
Salamandar's avatar
Salamandar committed
157
    - meson --prefix="${INSTALL_PREFIX}" _build
158 159
    - ninja -C _build
    - ninja -C _build install
160
  needs: ["build-image"]
161

Jehan's avatar
Jehan committed
162
.gimp-debian-base:
163
  stage: gimp
164
  image: $CI_REGISTRY_IMAGE:build-debian-latest
Jehan's avatar
Jehan committed
165
  dependencies:
Jehan's avatar
Jehan committed
166
    - deps-debian
167 168 169
  cache:
    paths:
    - apt-cache
170
  artifacts:
171
    expire_in: 1 days
Jehan's avatar
Jehan committed
172
    when: always
173
    name: "app-build-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
174
    paths:
Jehan's avatar
Jehan committed
175 176
    - _build
    #- "${INSTALL_DIR}"
177
  before_script:
178 179 180 181 182 183 184
    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig:${INSTALL_PREFIX}/share/pkgconfig"
    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/`gcc -print-multiarch`/pkgconfig/:$PKG_CONFIG_PATH"
    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/share/`gcc -print-multiarch`/pkgconfig/:$PKG_CONFIG_PATH"
    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib/`gcc -print-multiarch`:$LD_LIBRARY_PATH"
    - export XDG_DATA_DIRS="${INSTALL_PREFIX}/share:/usr/local/share:/usr/share"
    - export PATH="${INSTALL_PREFIX}/bin:$PATH"
Jehan's avatar
Jehan committed
185
  needs: ["deps-debian"]
186

Jehan's avatar
Jehan committed
187
gimp-distcheck-debian:
Jehan's avatar
Jehan committed
188 189 190 191 192 193 194 195
  rules:
    # On commits.
    - if: '$CI_PIPELINE_SOURCE == "push"'
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_AUTOTOOLS != null'
    - if: '$GIMP_CI_SOURCES != null'
Jehan's avatar
Jehan committed
196
  extends: .gimp-debian-base
197 198 199 200 201 202 203 204
  script:
    - mkdir _build
    - cd _build
    - ../autogen.sh
        --prefix="${INSTALL_PREFIX}"
        --enable-debug
        --enable-gtk-doc
    - make -j "$(nproc)"
205
    - make -j "$(nproc)" check
206
    - make -j "$(nproc)" distcheck
207

Jehan's avatar
Jehan committed
208
gimp-meson-debian:
209
  rules:
Jehan's avatar
Jehan committed
210 211 212 213
    # On commits except tags.
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG == null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_MESON_GCC != null'
Jehan's avatar
Jehan committed
214
  extends: .gimp-debian-base
Salamandar's avatar
Salamandar committed
215 216 217 218
  script:
    - meson _build
      --prefix="${INSTALL_PREFIX}"
    - ninja -C _build
219
    - ninja -C _build test
Salamandar's avatar
Salamandar committed
220

Jehan's avatar
Jehan committed
221
gimp-clang-debian:
222
  rules:
Jehan's avatar
Jehan committed
223 224
    # Custom builds only (web GUI, API or schedules).
    - if: '$GIMP_CI_MESON_CLANG != null'
Jehan's avatar
Jehan committed
225
  extends: .gimp-debian-base
Jehan's avatar
Jehan committed
226 227 228 229
  variables:
    CC: "clang"
    CXX: "clang++"
  script:
230
    - mkdir -p "$APT_CACHE"
231
    - apt-get install -y --no-install-recommends -o dir::cache::archives="$APT_CACHE"
232
        clang libomp-dev
Jehan's avatar
Jehan committed
233 234 235
    - meson _build
      --prefix="${INSTALL_PREFIX}"
    - ninja -C _build
236
    - ninja -C _build test
Jehan's avatar
Jehan committed
237

238
## WINDOWS 64-bit CI (native MSYS2) ##
Jehan's avatar
Jehan committed
239

240
deps-win64-native:
241
  rules:
Jehan's avatar
Jehan committed
242 243 244 245 246
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_MSYS2_WIN64 != null'
    - if: '$GIMP_CI_WIN_INSTALLER != null'
247
  stage: dependencies
248 249 250
  variables:
    MSYSTEM: "MINGW64"
    CHERE_INVOKING: "yes"
251 252 253 254 255 256 257 258 259 260
  tags:
    - win32-ps
  script:
    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-deps-msys2.sh"
  artifacts:
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
    when: always
    expire_in: 2 hours
    paths:
261
      - _install-w64
262
      - aalib-1.4.0/_build
263 264 265
  needs: []

gimp-win64-native:
266
  rules:
Jehan's avatar
Jehan committed
267 268 269 270 271
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_MSYS2_WIN64 != null'
    - if: '$GIMP_CI_WIN_INSTALLER != null'
272
  stage: gimp
273 274 275
  variables:
    MSYSTEM: "MINGW64"
    CHERE_INVOKING: "yes"
276 277 278 279
  tags:
    - win32-ps
  script:
    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
280
    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-gimp-msys2.sh"
281
  artifacts:
282
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
283
    when: always
284
    expire_in: 1 day
285
    paths:
286 287
    - _install-w64
    - build/windows/installer/lang/
288 289 290
  cache:
    paths:
    - _ccache/
291 292
  needs: ["deps-win64-native"]

293 294 295 296
## WINDOWS 32-bit CI (native MSYS2) ##

deps-win32-native:
  rules:
Jehan's avatar
Jehan committed
297 298 299 300 301
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_MSYS2_WIN32 != null'
    - if: '$GIMP_CI_WIN_INSTALLER != null'
302 303 304 305 306 307 308 309 310 311 312 313 314 315
  stage: dependencies
  variables:
    MSYSTEM: "MINGW32"
    CHERE_INVOKING: "yes"
  tags:
    - win32-ps
  script:
    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-deps-msys2.sh"
  artifacts:
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
    when: always
    expire_in: 2 hours
    paths:
316
      - _install-w32
317 318 319 320
  needs: []

gimp-win32-native:
  rules:
Jehan's avatar
Jehan committed
321 322 323 324 325
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_MSYS2_WIN32 != null'
    - if: '$GIMP_CI_WIN_INSTALLER != null'
326 327 328 329 330 331 332 333 334 335 336 337 338 339
  stage: gimp
  variables:
    MSYSTEM: "MINGW32"
    CHERE_INVOKING: "yes"
  tags:
    - win32-ps
  script:
    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-gimp-msys2.sh"
  artifacts:
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
    when: always
    expire_in: 1 day
    paths:
340
    - _install-w32
341 342 343 344 345
  cache:
    paths:
    - _ccache/
  needs: ["deps-win32-native"]

346
## WINDOWS 64-bit CI (cross-build crossroad) ##
347

Jehan's avatar
Jehan committed
348
deps-win64:
349
  rules:
Jehan's avatar
Jehan committed
350 351 352 353
    # On commits except tags.
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG == null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_CROSSROAD_WIN64 != null'
Jehan's avatar
Jehan committed
354
  stage: dependencies
355
  image: $CI_REGISTRY_IMAGE:build-win64-latest
Jehan's avatar
Jehan committed
356 357 358 359 360 361
  variables:
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache/"
    XDG_DATA_HOME:  "$CI_PROJECT_DIR/.local/share/"
  cache:
    paths:
    - .cache/crossroad/
362
    - apt-cache
363
  before_script:
364 365 366
    - apt-get update
    - apt-get install -y --no-install-recommends wine wine64

367
    - git clone --depth=${GIT_DEPTH} git://git.tuxfamily.org/gitroot/crossroad/crossroad.git
368
    - cd crossroad
Jehan's avatar
Jehan committed
369
    - ./setup.py install --prefix=`pwd`/../.local
370
    - cd ..
Jehan's avatar
Jehan committed
371
    - pip3 install zstandard
Jehan's avatar
Jehan committed
372 373
  script:
    - export PATH="`pwd`/.local/bin:$PATH"
374
    - crossroad w64 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh"
Jehan's avatar
Jehan committed
375
  artifacts:
376
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
Jehan's avatar
Jehan committed
377
    when: always
378
    expire_in: 2 hours
Jehan's avatar
Jehan committed
379 380 381
    paths:
      - .local/
      - _deps/
382
  needs: ["build-image-win64"]
383

Jehan's avatar
Jehan committed
384
gimp-win64:
385
  rules:
Jehan's avatar
Jehan committed
386 387 388 389
    # On commits except tags.
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG == null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_CROSSROAD_WIN64 != null'
Jehan's avatar
Jehan committed
390
  stage: gimp
391
  image: $CI_REGISTRY_IMAGE:build-win64-latest
Jehan's avatar
Jehan committed
392
  dependencies:
Jehan's avatar
Jehan committed
393
    - deps-win64
394 395
  variables:
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache/"
Jehan's avatar
Jehan committed
396
    XDG_DATA_HOME:  "$CI_PROJECT_DIR/.local/share/"
397 398 399
  cache:
    paths:
    - .cache/crossroad/
400
    - apt-cache
401
  script:
Jehan's avatar
Jehan committed
402 403 404
    - export PATH="`pwd`/.local/bin:$PATH"
    - mkdir _build && cd _build
    - echo 'crossroad meson ..
405
              -Dgtk-doc=false && ninja install &&
406
            cp -fr $CROSSROAD_PREFIX/ ../gimp-prefix/
407
            ' |
Jehan's avatar
Jehan committed
408
      crossroad w64 gimp --run="-"
Jehan's avatar
Jehan committed
409
  needs: ["deps-win64"]
410
  artifacts:
411
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
Jehan's avatar
Jehan committed
412
    when: always
413
    expire_in: 1 day
414 415
    paths:
      - _build/
416
      - gimp-prefix/
Jehan's avatar
Jehan committed
417

418
## WINDOWS 32-bit CI (cross-build crossroad) ##
Jehan's avatar
Jehan committed
419

Jehan's avatar
Jehan committed
420
deps-win32:
421
  rules:
Jehan's avatar
Jehan committed
422 423
    # Custom builds only (web GUI, API or schedules).
    - if: '$GIMP_CI_CROSSROAD_WIN32 != null'
Jehan's avatar
Jehan committed
424
  stage: dependencies
425
  image: $CI_REGISTRY_IMAGE:build-win32-latest
Jehan's avatar
Jehan committed
426 427 428 429 430 431
  variables:
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache/"
    XDG_DATA_HOME:  "$CI_PROJECT_DIR/.local/share/"
  cache:
    paths:
    - .cache/crossroad/
432
    - apt-cache
Jehan's avatar
Jehan committed
433
  before_script:
434
    - git clone --depth=${GIT_DEPTH} git://git.tuxfamily.org/gitroot/crossroad/crossroad.git
Jehan's avatar
Jehan committed
435 436 437
    - cd crossroad
    - ./setup.py install --prefix=`pwd`/../.local
    - cd ..
Jehan's avatar
Jehan committed
438
    - pip3 install zstandard
Jehan's avatar
Jehan committed
439 440
  script:
    - export PATH="`pwd`/.local/bin:$PATH"
441
    - crossroad w32 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh"
Jehan's avatar
Jehan committed
442
  artifacts:
443
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
Jehan's avatar
Jehan committed
444
    when: always
445
    expire_in: 2 hours
Jehan's avatar
Jehan committed
446 447 448
    paths:
      - .local/
      - _deps/
449
  needs: ["build-image-win32"]
Jehan's avatar
Jehan committed
450

Jehan's avatar
Jehan committed
451
gimp-win32:
452
  rules:
Jehan's avatar
Jehan committed
453 454
    # Custom builds only (web GUI, API or schedules).
    - if: '$GIMP_CI_CROSSROAD_WIN32 != null'
Jehan's avatar
Jehan committed
455
  stage: gimp
456
  image: $CI_REGISTRY_IMAGE:build-win32-latest
Jehan's avatar
Jehan committed
457
  dependencies:
Jehan's avatar
Jehan committed
458
    - deps-win32
Jehan's avatar
Jehan committed
459 460 461 462 463 464
  variables:
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache/"
    XDG_DATA_HOME:  "$CI_PROJECT_DIR/.local/share/"
  cache:
    paths:
    - .cache/crossroad/
465
    - apt-cache
Jehan's avatar
Jehan committed
466 467 468 469
  script:
    - export PATH="`pwd`/.local/bin:$PATH"
    - mkdir _build && cd _build
    - echo 'crossroad meson ..
470
              -Dwmf=disabled  -Dmng=disabled -Dgtk-doc=false && ninja install &&
Jehan's avatar
Jehan committed
471 472 473
            cp -fr $CROSSROAD_PREFIX/ ../gimp-prefix/
            ' |
      crossroad w32 gimp --run="-"
Jehan's avatar
Jehan committed
474
  needs: ["deps-win32"]
Jehan's avatar
Jehan committed
475
  artifacts:
476
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
Jehan's avatar
Jehan committed
477
    when: always
478
    expire_in: 1 day
Jehan's avatar
Jehan committed
479 480 481
    paths:
      - _build/
      - gimp-prefix/
482 483

cppcheck:
484
  rules:
Jehan's avatar
Jehan committed
485 486
    # Custom builds only (web GUI, API or schedules).
    - if: '$GIMP_CI_CPPCHECK != null'
487 488 489 490 491
  stage: analysis
  before_script:
    - apt-get update
    - apt-get install -y cppcheck
  script:
492 493
    - cppcheck -q -j8 --enable=all --force --output-file=cppcheck.xml --xml --xml-version=2
        -i _build -i _deps -i gimp-prefix -i .local -i .cache .
494 495 496
    - mkdir report
    - cppcheck-htmlreport --source-dir=. --title=gimp --file=cppcheck.xml --report-dir=report
  artifacts:
497
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
498 499 500 501
    expire_in: 1 week
    when: always
    paths:
      - report
502
  needs: []
Jehan's avatar
Jehan committed
503 504 505

## Ready-to-distribute ##

506
win-installer-nightly:
507
  rules:
Jehan's avatar
Jehan committed
508 509 510 511
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_WIN_INSTALLER != null'
512 513 514 515 516 517 518
  variables:
    CHERE_INVOKING: "yes"
  tags:
    - win32-ps
  stage: distribution
  dependencies:
    - gimp-win64-native
519 520 521 522 523 524
    - gimp-win32-native
  artifacts:
    name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
    when: always
    expire_in: 2 days
    paths:
525
    - build/windows/installer/_Output
526 527
  script:
    - C:\msys64\usr\bin\pacman --noconfirm -Syyuu
528 529 530 531
    - C:\msys64\usr\bin\bash -lc "MSYSTEM=MINGW64 bash -x ./build/windows/gitlab-ci/package-gimp-msys2.sh"
    - C:\msys64\usr\bin\bash -lc "MSYSTEM=MINGW32 bash -x ./build/windows/gitlab-ci/package-gimp-msys2.sh"
    - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/installer-gimp-msys2.sh"
  needs: ["gimp-win32-native", "gimp-win64-native"]
532

Jehan's avatar
Jehan committed
533
sources:
Jehan's avatar
Jehan committed
534 535 536 537 538 539 540
  rules:
    # On commits.
    - if: '$CI_PIPELINE_SOURCE == "push"'
    # On releases.
    - if: '$CI_COMMIT_TAG != null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_SOURCES != null'
Jehan's avatar
Jehan committed
541 542 543 544
  stage: distribution
  dependencies:
    - gimp-distcheck-debian
  artifacts:
545
    name: "GIMP-sources-${CI_COMMIT_SHORT_SHA}"
Jehan's avatar
Jehan committed
546
    when: always
547
    expire_in: 2 days
Jehan's avatar
Jehan committed
548
    paths:
549 550 551
    - gimp-*.tar.bz2
    - gimp-*.tar.bz2.SHA256SUMS
    - gimp-*.tar.bz2.SHA512SUMS
Jehan's avatar
Jehan committed
552
  script:
553 554 555 556
    - mv _build/gimp-*.tar.bz2 .
    - FILENAME=`ls gimp-*.tar.bz2` &&
      sha256sum gimp-*.tar.bz2 > ${FILENAME}.SHA256SUMS &&
      sha512sum gimp-*.tar.bz2 > ${FILENAME}.SHA512SUMS
Jehan's avatar
Jehan committed
557
  needs: ["gimp-distcheck-debian"]
558 559

win64-nightly:
560
  rules:
Jehan's avatar
Jehan committed
561 562 563 564
    # On commits except tags.
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG == null'
    # Custom builds though web GUI, API or schedules.
    - if: '$GIMP_CI_CROSSROAD_WIN64 != null'
565 566 567 568 569 570 571
  stage: distribution
  dependencies:
    - gimp-win64
  variables:
    GIMP_PREFIX: "gimp-prefix"
    GIMP_DISTRIB: "gimp-w64"
  artifacts:
572
    name: "GIMP-Win64-CI-${CI_COMMIT_SHORT_SHA}"
573
    when: always
574
    expire_in: 2 days
575 576 577 578
    paths:
    - gimp-w64
  script:
    - apt-get update
579 580 581
    - apt-get install -y --no-install-recommends
                      python3 binutils-mingw-w64-x86-64 file
                      libglib2.0-bin
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596

    # Package ressources.
    - mkdir -p ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/etc ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/include ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/ssl ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/share ${GIMP_DISTRIB}

    # Package executables.
    - mkdir ${GIMP_DISTRIB}/bin
    - cp -fr ${GIMP_PREFIX}/bin/gimp*.exe ${GIMP_DISTRIB}/bin/

    - mkdir ${GIMP_DISTRIB}/libexec
    - cp -fr ${GIMP_PREFIX}/libexec/gimp*.exe ${GIMP_DISTRIB}/libexec/

597 598 599
    # Add a wrapper at tree root, less messy than having to look for the
    # binary inside bin/, in the middle of all the DLLs.
    - echo "bin\gimp-2.99.exe" > ${GIMP_DISTRIB}/gimp.cmd
600 601 602 603 604 605 606 607 608 609

    # Package library data and modules.
    - mkdir ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gimp ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gio ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gdk-pixbuf-2.0 ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gegl-0.4 ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/babl-0.1 ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/girepository-1.0 ${GIMP_DISTRIB}/lib/

610 611 612
    # Generate share/glib-2.0/schemas/gschemas.compiled
    - glib-compile-schemas --targetdir=${GIMP_DISTRIB}/share/glib-2.0/schemas ${GIMP_DISTRIB}/share/glib-2.0/schemas

613
    # Package needed DLLs only
614 615 616 617
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
618 619

    - for dll in ${GIMP_DISTRIB}/lib/babl-0.1/*.dll; do
620
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
621 622
      done
    - for dll in ${GIMP_DISTRIB}/lib/gegl-0.4/*.dll; do
623
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
624 625
      done
    - for dll in ${GIMP_DISTRIB}/lib/gio/modules/*.dll; do
626
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
627 628
      done
    - for dll in ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do
629
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
630 631
      done
    - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/modules/*.dll; do
632
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
633 634
      done
    - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do
635
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
636 637 638 639
      done
  needs: ["gimp-win64"]

win32-nightly:
640
  rules:
Jehan's avatar
Jehan committed
641 642
    # Custom builds only (web GUI, API or schedules).
    - if: '$GIMP_CI_CROSSROAD_WIN32 != null'
643 644 645
  stage: distribution
  dependencies:
    - gimp-win32
646
    - deps-win64
647 648 649
  variables:
    GIMP_PREFIX: "gimp-prefix"
    GIMP_DISTRIB: "gimp-w32"
650
    XDG_DATA_HOME:  "$CI_PROJECT_DIR/.local/share/"
651
  artifacts:
652
    name: "GIMP-Win32-${CI_COMMIT_SHORT_SHA}"
653
    when: always
654
    expire_in: 2 days
655 656 657 658
    paths:
    - gimp-w32
  script:
    - apt-get update
659 660 661
    - apt-get install -y --no-install-recommends
                      python3 binutils-mingw-w64-i686 file
                      libglib2.0-bin
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676

    # Package ressources.
    - mkdir -p ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/etc ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/include ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/ssl ${GIMP_DISTRIB}
    - cp -fr ${GIMP_PREFIX}/share ${GIMP_DISTRIB}

    # Package executables.
    - mkdir ${GIMP_DISTRIB}/bin
    - cp -fr ${GIMP_PREFIX}/bin/gimp*.exe ${GIMP_DISTRIB}/bin/

    - mkdir ${GIMP_DISTRIB}/libexec
    - cp -fr ${GIMP_PREFIX}/libexec/gimp*.exe ${GIMP_DISTRIB}/libexec/

677 678 679
    # Add a wrapper at tree root, less messy than having to look for the
    # binary inside bin/, in the middle of all the DLLs.
    - echo "bin\gimp-2.99.exe" > ${GIMP_DISTRIB}/gimp.cmd
680 681 682 683 684 685 686 687 688 689

    # Package library data and modules.
    - mkdir ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gimp ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gio ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gdk-pixbuf-2.0 ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/gegl-0.4 ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/babl-0.1 ${GIMP_DISTRIB}/lib/
    - cp -fr ${GIMP_PREFIX}/lib/girepository-1.0 ${GIMP_DISTRIB}/lib/

690
    # I fail to install wine32 inside the Gitlab runner. So instead, I
691
    # just reuse the loaders.cache generated in the deps-win64 job as
692
    # they should be the same (text format).
693
    - cp ${XDG_DATA_HOME}/crossroad/roads/w64/gimp/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
694 695 696 697

    # Generate share/glib-2.0/schemas/gschemas.compiled
    - glib-compile-schemas --targetdir=${GIMP_DISTRIB}/share/glib-2.0/schemas ${GIMP_DISTRIB}/share/glib-2.0/schemas

698
    # Package needed DLLs only.
699 700 701 702
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
    - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB}
703 704

    - for dll in ${GIMP_DISTRIB}/lib/babl-0.1/*.dll; do
705
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
706 707
      done
    - for dll in ${GIMP_DISTRIB}/lib/gegl-0.4/*.dll; do
708
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
709 710
      done
    - for dll in ${GIMP_DISTRIB}/lib/gio/modules/*.dll; do
711
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
712 713
      done
    - for dll in ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do
714
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
715 716
      done
    - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/modules/*.dll; do
717
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
718 719
      done
    - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do
720
        python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB};
721
      done
722
  needs: ["gimp-win32", "deps-win64"]