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
12 MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
13 CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
19 - mkdir -p artifact/minetest/usr/
21 - cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
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/
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 ../../
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
65 extends: .build_template
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
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
77 extends: .debpkg_template
82 LEVELDB_PKG: libleveldb1
85 extends: .debpkg_install
90 LEVELDB_PKG: libleveldb1
95 extends: .build_template
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
102 extends: .debpkg_template
107 LEVELDB_PKG: libleveldb1v5
110 extends: .debpkg_install
115 LEVELDB_PKG: libleveldb1v5
120 extends: .build_template
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
127 extends: .debpkg_template
132 LEVELDB_PKG: libleveldb1d
135 extends: .debpkg_install
140 LEVELDB_PKG: libleveldb1d
148 extends: .build_template
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
160 LEVELDB_PKG: libleveldb1v5
163 extends: .debpkg_install
166 - package:ubuntu-16.04
168 LEVELDB_PKG: libleveldb1v5
173 extends: .build_template
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
185 LEVELDB_PKG: libleveldb1v5
188 extends: .debpkg_install
191 - package:ubuntu-18.04
193 LEVELDB_PKG: libleveldb1v5
199 # Do we need to support this old version ?
201 extends: .build_template
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
211 .generic_win_template:
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
220 extends: .generic_win_template
228 .package_win_template:
229 extends: .generic_win_template
232 - cd build/minetest/_build
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
247 extends: .build_win_template
249 - ./util/buildbot/buildwin32.sh build
255 extends: .package_win_template
263 extends: .build_win_template
265 - ./util/buildbot/buildwin64.sh build
271 extends: .package_win_template
284 - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
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
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
299 - cd doc/mkdocs && ./build.sh
306 package:appimage-client:
308 image: appimagecrafters/appimage-builder
313 - apt-get install -y git wget
316 - cp -a artifact/minetest/usr/ AppDir/usr/
317 - rm AppDir/usr/bin/minetestserver
318 - cp -R clientmods AppDir/usr/share/minetest
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