Miroir du dépôt minetest. https://gitlab.com/minetest/minetest.git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

311 lines
8.5KB

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