.gitlab-ci.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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: 1h
  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/
  39. artifacts:
  40. when: on_success
  41. expire_in: 30 day
  42. paths:
  43. - build/deb/*.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 build/deb/*.deb
  51. ##
  52. ## Debian
  53. ##
  54. # Jessie
  55. build:debian-8:
  56. <<: *build_definition
  57. image: debian:8
  58. before_script:
  59. - apt-get update -y
  60. - 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
  61. package:debian-8:
  62. image: debian:8
  63. dependencies:
  64. - build:debian-8
  65. variables:
  66. LEVELDB_PKG: libleveldb1
  67. <<: *debpkg_template
  68. deploy:debian-8:
  69. image: debian:8
  70. dependencies:
  71. - package:debian-8
  72. variables:
  73. LEVELDB_PKG: libleveldb1
  74. <<: *debpkg_install
  75. # Stretch
  76. build:debian-9:
  77. <<: *build_definition
  78. image: debian:9
  79. before_script:
  80. - apt-get update -y
  81. - 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
  82. package:debian-9:
  83. image: debian:9
  84. dependencies:
  85. - build:debian-9
  86. variables:
  87. LEVELDB_PKG: libleveldb1v5
  88. <<: *debpkg_template
  89. deploy:debian-9:
  90. image: debian:9
  91. dependencies:
  92. - package:debian-9
  93. variables:
  94. LEVELDB_PKG: libleveldb1v5
  95. <<: *debpkg_install
  96. ##
  97. ## Ubuntu
  98. ##
  99. # Trusty
  100. build:ubuntu-14.04:
  101. <<: *build_definition
  102. image: ubuntu:trusty
  103. before_script:
  104. - apt-get update -y
  105. - 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
  106. package:ubuntu-14.04:
  107. image: ubuntu:trusty
  108. dependencies:
  109. - build:ubuntu-14.04
  110. variables:
  111. LEVELDB_PKG: libleveldb1
  112. <<: *debpkg_template
  113. deploy:ubuntu-14.04:
  114. image: ubuntu:trusty
  115. dependencies:
  116. - package:ubuntu-14.04
  117. variables:
  118. LEVELDB_PKG: libleveldb1
  119. <<: *debpkg_install
  120. # Xenial
  121. build:ubuntu-16.04:
  122. <<: *build_definition
  123. image: ubuntu:xenial
  124. before_script:
  125. - apt-get update -y
  126. - 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. package:ubuntu-16.04:
  128. image: ubuntu:xenial
  129. dependencies:
  130. - build:ubuntu-16.04
  131. variables:
  132. LEVELDB_PKG: libleveldb1v5
  133. <<: *debpkg_template
  134. deploy:ubuntu-16.04:
  135. image: ubuntu:xenial
  136. dependencies:
  137. - package:ubuntu-16.04
  138. variables:
  139. LEVELDB_PKG: libleveldb1v5
  140. <<: *debpkg_install
  141. # Yakkety
  142. build:ubuntu-16.10:
  143. <<: *build_definition
  144. image: ubuntu:yakkety
  145. before_script:
  146. - apt-get update -y
  147. - 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
  148. package:ubuntu-16.10:
  149. image: ubuntu:yakkety
  150. dependencies:
  151. - build:ubuntu-16.10
  152. variables:
  153. LEVELDB_PKG: libleveldb1v5
  154. <<: *debpkg_template
  155. deploy:ubuntu-16.10:
  156. image: ubuntu:yakkety
  157. dependencies:
  158. - package:ubuntu-16.10
  159. variables:
  160. LEVELDB_PKG: libleveldb1v5
  161. <<: *debpkg_install
  162. # Zesty
  163. build:ubuntu-17.04:
  164. <<: *build_definition
  165. image: ubuntu:zesty
  166. before_script:
  167. - apt-get update -y
  168. - 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
  169. package:ubuntu-17.04:
  170. image: ubuntu:zesty
  171. dependencies:
  172. - build:ubuntu-17.04
  173. variables:
  174. LEVELDB_PKG: libleveldb1v5
  175. <<: *debpkg_template
  176. deploy:ubuntu-17.04:
  177. image: ubuntu:zesty
  178. dependencies:
  179. - package:ubuntu-17.04
  180. variables:
  181. LEVELDB_PKG: libleveldb1v5
  182. <<: *debpkg_install
  183. ##
  184. ## Fedora
  185. ##
  186. build:fedora-24:
  187. <<: *build_definition
  188. image: fedora:24
  189. before_script:
  190. - 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