.gitlab-ci.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. before_script:
  15. - apt-get update
  16. - DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential gettext git cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libleveldb-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev
  17. script:
  18. - git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
  19. - mkdir build && cd build
  20. - cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE ..
  21. - make -j $(($(nproc) + 1))
  22. - make install
  23. artifacts:
  24. when: on_success
  25. expire_in: 1h
  26. paths:
  27. - artifact/*
  28. ##
  29. ## Ubuntu (prerequisite for AppImage build)
  30. ##
  31. build:ubuntu-20.04:
  32. extends: .build_template
  33. image: ubuntu:focal
  34. ##
  35. ## MinGW for Windows
  36. ##
  37. .generic_win_template:
  38. image: ubuntu:focal
  39. before_script:
  40. - apt-get update
  41. - DEBIAN_FRONTEND=noninteractive apt-get install -y wget xz-utils unzip git cmake gettext
  42. - wget -nv http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
  43. - tar -xaf mingw.tar.xz -C /usr
  44. .build_win_template:
  45. extends: .generic_win_template
  46. stage: build
  47. artifacts:
  48. expire_in: 90 day
  49. paths:
  50. - minetest-*-win*/*
  51. build:win32:
  52. extends: .build_win_template
  53. script:
  54. - EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh build
  55. - unzip -q build/build/*.zip
  56. variables:
  57. WIN_ARCH: "i686"
  58. build:win64:
  59. extends: .build_win_template
  60. script:
  61. - EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh build
  62. - unzip -q build/build/*.zip
  63. variables:
  64. WIN_ARCH: "x86_64"
  65. ##
  66. ## Docker
  67. ##
  68. package:docker:
  69. stage: package
  70. image: docker:stable
  71. services:
  72. - docker:dind
  73. before_script:
  74. - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
  75. script:
  76. - ./util/ci/docker.sh
  77. ##
  78. ## Gitlab Pages (Lua API documentation)
  79. ##
  80. pages:
  81. stage: deploy
  82. image: python:3.8
  83. before_script:
  84. - pip install -U -r doc/mkdocs/requirements.txt
  85. script:
  86. - cd doc/mkdocs && ./build.sh
  87. artifacts:
  88. paths:
  89. - public
  90. only:
  91. - master
  92. ##
  93. ## AppImage
  94. ##
  95. package:appimage-client:
  96. stage: package
  97. image: appimagecrafters/appimage-builder
  98. needs:
  99. - build:ubuntu-20.04
  100. before_script:
  101. - apt-get update
  102. - apt-get install -y git
  103. # Collect files
  104. - mkdir AppDir
  105. - cp -a artifact/minetest/usr/ AppDir/usr/
  106. - cp -a clientmods AppDir/usr/share/minetest
  107. - git clone $MINETEST_GAME_REPO AppDir/usr/share/minetest/games/minetest_game
  108. - rm -rf AppDir/usr/share/minetest/games/minetest_game/.git
  109. # Remove PrefersNonDefaultGPU property due to validation errors
  110. - sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop
  111. script:
  112. - export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
  113. - appimage-builder --skip-test --recipe misc/AppImageBuilder.yml
  114. artifacts:
  115. expire_in: 90 day
  116. paths:
  117. - ./*.AppImage