optimize: remove early localplayer ref
[waspsaliva.git] / .gitlab-ci.yml
blobc3e120375fc11f10579d95953556b2f7a4e6dcf7
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_game
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 # Xenial
147 build:ubuntu-16.04:
148   extends: .build_template
149   image: ubuntu:xenial
150   before_script:
151     - apt-get update -y
152     - 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
154 package:ubuntu-16.04:
155   extends: .debpkg_template
156   image: ubuntu:xenial
157   dependencies:
158     - build:ubuntu-16.04
159   variables:
160     LEVELDB_PKG: libleveldb1v5
162 deploy:ubuntu-16.04:
163   extends: .debpkg_install
164   image: ubuntu:xenial
165   dependencies:
166     - package:ubuntu-16.04
167   variables:
168     LEVELDB_PKG: libleveldb1v5
170 # Bionic
172 build:ubuntu-18.04:
173   extends: .build_template
174   image: ubuntu:bionic
175   before_script:
176     - apt-get update -y
177     - 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
179 package:ubuntu-18.04:
180   extends: .debpkg_template
181   image: ubuntu:bionic
182   dependencies:
183     - build:ubuntu-18.04
184   variables:
185     LEVELDB_PKG: libleveldb1v5
187 deploy:ubuntu-18.04:
188   extends: .debpkg_install
189   image: ubuntu:bionic
190   dependencies:
191     - package:ubuntu-18.04
192   variables:
193     LEVELDB_PKG: libleveldb1v5
196 ## Fedora
199 # Do we need to support this old version ?
200 build:fedora-24:
201   extends: .build_template
202   image: fedora:24
203   before_script:
204     - 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
208 ## Mingw for Windows
211 .generic_win_template:
212   image: ubuntu:bionic
213   before_script:
214     - apt-get update -y
215     - apt-get install -y wget xz-utils unzip git cmake gettext
216     - wget -q http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
217     - tar -xaf mingw.tar.xz -C /usr
219 .build_win_template:
220   extends: .generic_win_template
221   stage: build
222   artifacts:
223     when: on_success
224     expire_in: 2h
225     paths:
226       - build/*
228 .package_win_template:
229   extends: .generic_win_template
230   stage: package
231   script:
232     - cd build/minetest/_build
233     - make package
234     - cd ../../../
235     - mkdir minetest-win-${WIN_ARCH}
236     - unzip build/minetest/_build/minetest-*-win*.zip -d minetest-win-${WIN_ARCH}
237     - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
238     - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
239     - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
240   artifacts:
241     when: on_success
242     expire_in: 90 day
243     paths:
244       - minetest-win-*/*
246 build:win32:
247   extends: .build_win_template
248   script:
249     - ./util/buildbot/buildwin32.sh build
250   variables:
251     NO_PACKAGE: "1"
252     WIN_ARCH: "i686"
254 package:win32:
255   extends: .package_win_template
256   dependencies:
257     - build:win32
258   variables:
259     NO_PACKAGE: "1"
260     WIN_ARCH: "i686"
262 build:win64:
263   extends: .build_win_template
264   script:
265     - ./util/buildbot/buildwin64.sh build
266   variables:
267     NO_PACKAGE: "1"
268     WIN_ARCH: "x86_64"
270 package:win64:
271   extends: .package_win_template
272   dependencies:
273     - build:win64
274   variables:
275     NO_PACKAGE: "1"
276     WIN_ARCH: "x86_64"
278 package:docker:
279   stage: package
280   image: docker:stable
281   services:
282     - docker:dind
283   before_script:
284     - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
285   script:
286     - docker build . -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME -t ${CONTAINER_IMAGE}/server:latest
287     - docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA
288     - docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME
289     - docker push ${CONTAINER_IMAGE}/server:latest
291 pages:
292   stage: deploy
293   image: python:3.8
294   before_script:
295     - pip install git+https://github.com/Python-Markdown/markdown.git
296     - pip install git+https://github.com/mkdocs/mkdocs.git
297     - pip install pygments
298   script:
299     - cd doc/mkdocs && ./build.sh
300   artifacts:
301     paths:
302       - public
303   only:
304     - master
306 package:appimage-client:
307   stage: package
308   image: appimagecrafters/appimage-builder
309   dependencies:
310     - build:ubuntu-18.04
311   before_script:
312     - apt-get update -y
313     - apt-get install -y git wget
314     # Collect files
315     - mkdir AppDir
316     - cp -a artifact/minetest/usr/ AppDir/usr/
317     - rm AppDir/usr/bin/minetestserver
318     - cp -R clientmods AppDir/usr/share/minetest
319   script:
320     - git clone $MINETEST_GAME_REPO AppDir/usr/share/minetest/games/minetest_game
321     - rm -Rf AppDir/usr/share/minetest/games/minetest/.git
322     - export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
323     # Remove PrefersNonDefaultGPU property due to validation errors
324     - sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop
325     - appimage-builder --skip-test
326   artifacts:
327     when: on_success
328     expire_in: 90 day
329     paths:
330       - ./*.AppImage