1
0
mirror of https://github.com/minetest/minetest.git synced 2024-11-11 12:50:38 +01:00
minetest/.gitlab-ci.yml

134 lines
3.4 KiB
YAML
Raw Normal View History

---
# Github repository is cloned every day on Gitlab.com
# https://gitlab.com/minetest/minetest
# Pipelines URL: https://gitlab.com/minetest/minetest/pipelines
stages:
- build
2017-04-21 10:22:20 +02:00
- package
- deploy
variables:
MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
.build_template:
stage: build
2021-03-10 15:27:19 +01:00
before_script:
- apt-get update
- 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
script:
- git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
2022-06-07 21:01:40 +02:00
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE ..
2022-06-07 21:01:40 +02:00
- make -j $(($(nproc) + 1))
- make install
artifacts:
when: on_success
2021-01-02 15:43:35 +01:00
expire_in: 1h
paths:
- artifact/*
##
## Ubuntu (prerequisite for AppImage build)
##
2017-04-21 10:22:20 +02:00
build:ubuntu-20.04:
extends: .build_template
image: ubuntu:focal
##
2021-01-02 15:43:35 +01:00
## MinGW for Windows
##
.generic_win_template:
2021-04-27 23:41:35 +02:00
image: ubuntu:focal
before_script:
2021-03-10 15:27:19 +01:00
- apt-get update
2021-04-27 23:41:35 +02:00
- DEBIAN_FRONTEND=noninteractive apt-get install -y wget xz-utils unzip git cmake gettext
- wget -nv http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
- tar -xaf mingw.tar.xz -C /usr
.build_win_template:
extends: .generic_win_template
stage: build
artifacts:
expire_in: 90 day
paths:
2021-01-02 15:43:35 +01:00
- minetest-*-win*/*
build:win32:
extends: .build_win_template
script:
2021-03-10 15:27:19 +01:00
- EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh build
- unzip -q build/build/*.zip
variables:
WIN_ARCH: "i686"
build:win64:
extends: .build_win_template
script:
2021-03-10 15:27:19 +01:00
- EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh build
- unzip -q build/build/*.zip
variables:
WIN_ARCH: "x86_64"
2021-01-02 15:43:35 +01:00
##
## Docker
##
package:docker:
stage: package
image: docker:stable
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- ./util/ci/docker.sh
2021-01-02 15:43:35 +01:00
##
## Gitlab Pages (Lua API documentation)
##
pages:
stage: deploy
2020-04-11 20:38:39 +02:00
image: python:3.8
before_script:
- pip install -U -r doc/mkdocs/requirements.txt
script:
- cd doc/mkdocs && ./build.sh
artifacts:
paths:
- public
only:
- master
2021-01-02 15:43:35 +01:00
##
## AppImage
##
package:appimage-client:
stage: package
image: appimagecrafters/appimage-builder
2021-01-02 15:43:35 +01:00
needs:
- build:ubuntu-20.04
before_script:
- apt-get update
- apt-get install -y git
# Collect files
- mkdir AppDir
- cp -a artifact/minetest/usr/ AppDir/usr/
2021-01-02 15:43:35 +01:00
- cp -a clientmods AppDir/usr/share/minetest
- git clone $MINETEST_GAME_REPO AppDir/usr/share/minetest/games/minetest_game
- rm -rf AppDir/usr/share/minetest/games/minetest_game/.git
# Remove PrefersNonDefaultGPU property due to validation errors
- sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop
script:
- export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
- appimage-builder --skip-test --recipe misc/AppImageBuilder.yml
artifacts:
expire_in: 90 day
paths:
- ./*.AppImage