.gitlab-ci.yml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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
  5. stages:
  6. - build
  7. - package
  8. - deploy
  9. variables:
  10. MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
  11. .build_template: &build_definition
  12. stage: build
  13. script:
  14. - mkdir cmakebuild
  15. - mkdir -p artifact/minetest/usr/
  16. - cd cmakebuild
  17. - cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
  18. - make -j2
  19. - make install
  20. artifacts:
  21. when: on_success
  22. expire_in: 2h
  23. paths:
  24. - artifact/*
  25. .debpkg_template: &debpkg_template
  26. stage: package
  27. before_script:
  28. - apt-get update -y
  29. - apt-get install -y git
  30. - mkdir -p build/deb/minetest/DEBIAN/
  31. - cp misc/debpkg-control build/deb/minetest/DEBIAN/control
  32. - cp -Rp artifact/minetest/usr build/deb/minetest/
  33. script:
  34. - git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest
  35. - rm -Rf build/deb/minetest/usr/share/minetest/games/minetest/.git
  36. - sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
  37. - sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
  38. - cd build/deb/ && dpkg-deb -b minetest/ && mv minetest.deb ../../
  39. artifacts:
  40. when: on_success
  41. expire_in: 90 day
  42. paths:
  43. - ./*.deb
  44. .debpkg_install: &debpkg_install
  45. stage: deploy
  46. before_script:
  47. - apt-get update -y
  48. - 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
  49. script:
  50. - dpkg -i ./*.deb
  51. ##
  52. ## Debian
  53. ##
  54. # Jessie
  55. build:debian-8:
  56. <<: *build_definition
  57. image: debian:8
  58. before_script:
  59. - echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list
  60. - apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F
  61. - apt-get update -y
  62. - 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
  63. variables:
  64. CC: gcc-6
  65. CXX: g++-6
  66. package:debian-8:
  67. image: debian:8
  68. dependencies:
  69. - build:debian-8
  70. variables:
  71. LEVELDB_PKG: libleveldb1
  72. <<: *debpkg_template
  73. deploy:debian-8:
  74. image: debian:8
  75. dependencies:
  76. - package:debian-8
  77. variables:
  78. LEVELDB_PKG: libleveldb1
  79. <<: *debpkg_install
  80. # Stretch
  81. build:debian-9:
  82. <<: *build_definition
  83. image: debian:9
  84. before_script:
  85. - apt-get update -y
  86. - 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
  87. package:debian-9:
  88. image: debian:9
  89. dependencies:
  90. - build:debian-9
  91. variables:
  92. LEVELDB_PKG: libleveldb1v5
  93. <<: *debpkg_template
  94. deploy:debian-9:
  95. image: debian:9
  96. dependencies:
  97. - package:debian-9
  98. variables:
  99. LEVELDB_PKG: libleveldb1v5
  100. <<: *debpkg_install
  101. ##
  102. ## Ubuntu
  103. ##
  104. # Trusty
  105. build:ubuntu-14.04:
  106. <<: *build_definition
  107. image: ubuntu:trusty
  108. before_script:
  109. - echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" > /etc/apt/sources.list.d/uptodate-toolchain.list
  110. - apt-key adv --keyserver keyserver.ubuntu.com --recv BA9EF27F
  111. - apt-get update -y
  112. - 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
  113. variables:
  114. CC: gcc-6
  115. CXX: g++-6
  116. package:ubuntu-14.04:
  117. image: ubuntu:trusty
  118. dependencies:
  119. - build:ubuntu-14.04
  120. variables:
  121. LEVELDB_PKG: libleveldb1
  122. <<: *debpkg_template
  123. deploy:ubuntu-14.04:
  124. image: ubuntu:trusty
  125. dependencies:
  126. - package:ubuntu-14.04
  127. variables:
  128. LEVELDB_PKG: libleveldb1
  129. <<: *debpkg_install
  130. # Xenial
  131. build:ubuntu-16.04:
  132. <<: *build_definition
  133. image: ubuntu:xenial
  134. before_script:
  135. - apt-get update -y
  136. - 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
  137. package:ubuntu-16.04:
  138. image: ubuntu:xenial
  139. dependencies:
  140. - build:ubuntu-16.04
  141. variables:
  142. LEVELDB_PKG: libleveldb1v5
  143. <<: *debpkg_template
  144. deploy:ubuntu-16.04:
  145. image: ubuntu:xenial
  146. dependencies:
  147. - package:ubuntu-16.04
  148. variables:
  149. LEVELDB_PKG: libleveldb1v5
  150. <<: *debpkg_install
  151. # Yakkety
  152. build:ubuntu-16.10:
  153. <<: *build_definition
  154. image: ubuntu:yakkety
  155. before_script:
  156. - apt-get update -y
  157. - 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
  158. package:ubuntu-16.10:
  159. image: ubuntu:yakkety
  160. dependencies:
  161. - build:ubuntu-16.10
  162. variables:
  163. LEVELDB_PKG: libleveldb1v5
  164. <<: *debpkg_template
  165. deploy:ubuntu-16.10:
  166. image: ubuntu:yakkety
  167. dependencies:
  168. - package:ubuntu-16.10
  169. variables:
  170. LEVELDB_PKG: libleveldb1v5
  171. <<: *debpkg_install
  172. # Zesty
  173. build:ubuntu-17.04:
  174. <<: *build_definition
  175. image: ubuntu:zesty
  176. before_script:
  177. - apt-get update -y
  178. - 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-17.04:
  180. image: ubuntu:zesty
  181. dependencies:
  182. - build:ubuntu-17.04
  183. variables:
  184. LEVELDB_PKG: libleveldb1v5
  185. <<: *debpkg_template
  186. deploy:ubuntu-17.04:
  187. image: ubuntu:zesty
  188. dependencies:
  189. - package:ubuntu-17.04
  190. variables:
  191. LEVELDB_PKG: libleveldb1v5
  192. <<: *debpkg_install
  193. ##
  194. ## Fedora
  195. ##
  196. build:fedora-24:
  197. <<: *build_definition
  198. image: fedora:24
  199. before_script:
  200. - 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
  201. ##
  202. ## Mingw for Windows
  203. ##
  204. .generic_win_template: &generic_win_template
  205. image: ubuntu:xenial
  206. before_script:
  207. - apt-get update -y
  208. - apt-get install -y p7zip-full wget unzip git cmake gettext
  209. - wget http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_7.1.1_ubuntu14.04.7z -O mingw.7z > /dev/null
  210. - sed -e "s|%PREFIX%|${WIN_ARCH}-w64-mingw32|" -e "s|%ROOTPATH%|/usr/${WIN_ARCH}-w64-mingw32|" < util/travis/toolchain_mingw.cmake.in > ${TOOLCHAIN_OUTPUT}
  211. - 7z x -y -o/usr mingw.7z > /dev/null
  212. .build_win_template: &build_win_template
  213. <<: *generic_win_template
  214. stage: build
  215. artifacts:
  216. when: on_success
  217. expire_in: 2h
  218. paths:
  219. - build/*
  220. .package_win_template: &package_win_template
  221. <<: *generic_win_template
  222. stage: package
  223. script:
  224. - cd build/minetest/_build
  225. - make package
  226. - cd ../../../
  227. - mkdir minetest-win-${WIN_ARCH}
  228. - unzip build/minetest/_build/minetest-*-win*.zip -d minetest-win-${WIN_ARCH}
  229. - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
  230. - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
  231. - cp /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll minetest-win-${WIN_ARCH}/minetest-*-win*/bin
  232. artifacts:
  233. when: on_success
  234. expire_in: 90 day
  235. paths:
  236. - minetest-win-*/*
  237. build:win32:
  238. <<: *build_win_template
  239. script:
  240. - ./util/buildbot/buildwin32.sh build
  241. variables:
  242. NO_PACKAGE: "1"
  243. WIN_ARCH: "i686"
  244. TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw.cmake"
  245. package:win32:
  246. <<: *package_win_template
  247. dependencies:
  248. - build:win32
  249. variables:
  250. NO_PACKAGE: "1"
  251. WIN_ARCH: "i686"
  252. TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw.cmake"
  253. build:win64:
  254. <<: *build_win_template
  255. script:
  256. - ./util/buildbot/buildwin64.sh build
  257. variables:
  258. NO_PACKAGE: "1"
  259. WIN_ARCH: "x86_64"
  260. TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw64.cmake"
  261. package:win64:
  262. <<: *package_win_template
  263. dependencies:
  264. - build:win64
  265. variables:
  266. NO_PACKAGE: "1"
  267. WIN_ARCH: "x86_64"
  268. TOOLCHAIN_OUTPUT: "util/buildbot/toolchain_mingw64.cmake"