kamikaze: widen search area, add sponges as badnode
[waspsaliva.git] / .gitlab-ci.yml
blobd03b7b6014a7cf118b5b3f2b9a5a4b10f48f9883
1 ---
2 # Github repository is cloned every day on Gitlab.com
3 # https://gitlab.com/minetest/minetest
4 # Pipelines URL: https://gitlab.com/minetest/minetest/pipelines
6 stages:
7   - build
8   - package
9   - deploy
11 variables:
12   MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
13   CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
15 .build_template:
16   stage: build
17   script:
18     - mkdir cmakebuild
19     - mkdir -p artifact/minetest/usr/
20     - cd cmakebuild
21     - cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
22     - make -j2
23     - make install
24   artifacts:
25     when: on_success
26     expire_in: 2h
27     paths:
28       - artifact/*
30 .debpkg_template:
31   stage: package
32   before_script:
33     - apt-get update -y
34     - apt-get install -y git
35     - mkdir -p build/deb/minetest/DEBIAN/
36     - cp misc/debpkg-control build/deb/minetest/DEBIAN/control
37     - cp -Rp artifact/minetest/usr build/deb/minetest/
38   script:
39     - git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest
40     - rm -Rf build/deb/minetest/usr/share/minetest/games/minetest/.git
41     - sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
42     - sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
43     - cd build/deb/ && dpkg-deb -b minetest/ && mv minetest.deb ../../
44   artifacts:
45     when: on_success
46     expire_in: 90 day
47     paths:
48       - ./*.deb
50 .debpkg_install:
51   stage: deploy
52   before_script:
53     - apt-get update -y
54     - apt-get install -y libc6 libcurl3-gnutls libfreetype6 libirrlicht1.8 $LEVELDB_PKG liblua5.1-0 libluajit-5.1-2 libopenal1 libstdc++6 libvorbisfile3 libx11-6 zlib1g
55   script:
56     - dpkg -i ./*.deb
59 ## Debian
62 # Jessie
64 build:debian-8:
65   extends: .build_template
66   image: debian:8
67   before_script:
68     - echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list
69     - apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F
70     - apt-get update -y
71     - apt-get -y install build-essential gcc-6 g++-6 libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
72   variables:
73     CC: gcc-6
74     CXX: g++-6
76 package:debian-8:
77   extends: .debpkg_template
78   image: debian:8
79   dependencies:
80     - build:debian-8
81   variables:
82     LEVELDB_PKG: libleveldb1
84 deploy:debian-8:
85   extends: .debpkg_install
86   image: debian:8
87   dependencies:
88     - package:debian-8
89   variables:
90     LEVELDB_PKG: libleveldb1
92 # Stretch
94 build:debian-9:
95  extends: .build_template
96  image: debian:9
97  before_script:
98    - apt-get update -y
99    - apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
101 package:debian-9:
102   extends: .debpkg_template
103   image: debian:9
104   dependencies:
105     - build:debian-9
106   variables:
107     LEVELDB_PKG: libleveldb1v5
109 deploy:debian-9:
110   extends: .debpkg_install
111   image: debian:9
112   dependencies:
113     - package:debian-9
114   variables:
115     LEVELDB_PKG: libleveldb1v5
117 # Stretch
119 build:debian-10:
120  extends: .build_template
121  image: debian:10
122  before_script:
123    - apt-get update -y
124    - apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
126 package:debian-10:
127   extends: .debpkg_template
128   image: debian:10
129   dependencies:
130     - build:debian-10
131   variables:
132     LEVELDB_PKG: libleveldb1d
134 deploy:debian-10:
135   extends: .debpkg_install
136   image: debian:10
137   dependencies:
138     - package:debian-10
139   variables:
140     LEVELDB_PKG: libleveldb1d
142 ## Ubuntu
145 # Trusty
147 build:ubuntu-14.04:
148   extends: .build_template
149   image: ubuntu:trusty
150   before_script:
151     - echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list
152     - apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F
153     - apt-get update -y
154     - apt-get -y install build-essential gcc-6 g++-6 libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
155   variables:
156     CC: gcc-6
157     CXX: g++-6
159 package:ubuntu-14.04:
160   extends: .debpkg_template
161   image: ubuntu:trusty
162   dependencies:
163     - build:ubuntu-14.04
164   variables:
165     LEVELDB_PKG: libleveldb1
167 deploy:ubuntu-14.04:
168   extends: .debpkg_install
169   image: ubuntu:trusty
170   dependencies:
171     - package:ubuntu-14.04
172   variables:
173     LEVELDB_PKG: libleveldb1
175 # Xenial
177 build:ubuntu-16.04:
178   extends: .build_template
179   image: ubuntu:xenial
180   before_script:
181     - apt-get update -y
182     - apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
184 package:ubuntu-16.04:
185   extends: .debpkg_template
186   image: ubuntu:xenial
187   dependencies:
188     - build:ubuntu-16.04
189   variables:
190     LEVELDB_PKG: libleveldb1v5
192 deploy:ubuntu-16.04:
193   extends: .debpkg_install
194   image: ubuntu:xenial
195   dependencies:
196     - package:ubuntu-16.04
197   variables:
198     LEVELDB_PKG: libleveldb1v5
201 ## Fedora
204 # Do we need to support this old version ?
205 build:fedora-24:
206   extends: .build_template
207   image: fedora:24
208   before_script:
209     - dnf -y install make automake gcc gcc-c++ kernel-devel cmake libcurl* openal* libvorbis* libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel irrlicht-devel bzip2-libs gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel doxygen spatialindex-devel bzip2-devel
213 ## Mingw for Windows
216 .generic_win_template:
217   image: ubuntu:bionic
218   before_script:
219     - apt-get update -y
220     - apt-get install -y wget xz-utils unzip git cmake gettext
221     - wget -q http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
222     - tar -xaf mingw.tar.xz -C /usr
224 .build_win_template:
225   extends: .generic_win_template
226   stage: build
227   artifacts:
228     when: on_success
229     expire_in: 2h
230     paths:
231       - build/*
233 .package_win_template:
234   extends: .generic_win_template
235   stage: package
236   script:
237     - cd build/minetest/_build
238     - make package
239     - cd ../../../
240     - mkdir minetest-win-${WIN_ARCH}
241     - unzip build/minetest/_build/minetest-*-win*.zip -d minetest-win-${WIN_ARCH}
242     - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
243     - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
244     - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
245   artifacts:
246     when: on_success
247     expire_in: 90 day
248     paths:
249       - minetest-win-*/*
251 build:win32:
252   extends: .build_win_template
253   script:
254     - ./util/buildbot/buildwin32.sh build
255   variables:
256     NO_PACKAGE: "1"
257     WIN_ARCH: "i686"
259 package:win32:
260   extends: .package_win_template
261   dependencies:
262     - build:win32
263   variables:
264     NO_PACKAGE: "1"
265     WIN_ARCH: "i686"
267 build:win64:
268   extends: .build_win_template
269   script:
270     - ./util/buildbot/buildwin64.sh build
271   variables:
272     NO_PACKAGE: "1"
273     WIN_ARCH: "x86_64"
275 package:win64:
276   extends: .package_win_template
277   dependencies:
278     - build:win64
279   variables:
280     NO_PACKAGE: "1"
281     WIN_ARCH: "x86_64"
283 package:docker:
284   stage: package
285   image: docker:stable
286   services:
287     - docker:dind
288   before_script:
289     - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
290   script:
291     - docker build . -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME -t ${CONTAINER_IMAGE}/server:latest
292     - docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA
293     - docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME
294     - docker push ${CONTAINER_IMAGE}/server:latest
296 pages:
297   stage: deploy
298   image: python:3.8
299   before_script:
300     - pip install git+https://github.com/Python-Markdown/markdown.git
301     - pip install git+https://github.com/mkdocs/mkdocs.git
302     - pip install pygments
303   script:
304     - cd doc/mkdocs && ./build.sh
305   artifacts:
306     paths:
307       - public
308   only:
309     - master