summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: ef3b371a4b1a905054698426a97e9e12ebe63658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
---
# Github repository is cloned every day on Gitlab.com
# https://gitlab.com/minetest/minetest
# Pipelines URL: https://gitlab.com/minetest/minetest/pipelines

stages:
  - build
  - package
  - deploy

variables:
  MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"

.build_template: &build_definition
  stage: build
  script:
    - mkdir cmakebuild
    - mkdir -p artifact/minetest/usr/
    - cd cmakebuild
    - cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
    - make -j2
    - make install
  artifacts:
    when: on_success
    expire_in: 1h
    paths:
      - artifact/*

.debpkg_template: &debpkg_template
  stage: package
  before_script:
    - apt-get update -y
    - apt-get install -y git
    - mkdir -p build/deb/minetest/DEBIAN/
    - cp misc/debpkg-control build/deb/minetest/DEBIAN/control
    - cp -Rp artifact/minetest/usr build/deb/minetest/
  script:
    - git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest
    - rm -Rf build/deb/minetest/usr/share/minetest/games/minetest/.git
    - sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
    - sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
    - cd build/deb/ && dpkg-deb -b minetest/
  artifacts:
    when: on_success
    expire_in: 30 day
    paths:
      - build/deb/*.deb

.debpkg_install: &debpkg_install
  stage: deploy
  before_script:
    - apt-get update -y
    - 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
  script:
    - dpkg -i build/deb/*.deb

##
## Debian
##

# Jessie

build:debian-8:
  <<: *build_definition
  image: debian:8
  before_script:
    - apt-get update -y
    - 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

package:debian-8:
  image: debian:8
  dependencies:
    - build:debian-8
  variables:
    LEVELDB_PKG: libleveldb1
  <<: *debpkg_template

deploy:debian-8:
  image: debian:8
  dependencies:
    - package:debian-8
  variables:
    LEVELDB_PKG: libleveldb1
  <<: *debpkg_install

# Stretch

build:debian-9:
 <<: *build_definition
 image: debian:9
 before_script:
   - apt-get update -y
   - 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

package:debian-9:
  image: debian:9
  dependencies:
    - build:debian-9
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_template

deploy:debian-9:
  image: debian:9
  dependencies:
    - package:debian-9
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_install

##
## Ubuntu
##

# Trusty

build:ubuntu-14.04:
 <<: *build_definition
 image: ubuntu:trusty
 before_script:
   - apt-get update -y
   - 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

package:ubuntu-14.04:
  image: ubuntu:trusty
  dependencies:
    - build:ubuntu-14.04
  variables:
    LEVELDB_PKG: libleveldb1
  <<: *debpkg_template

deploy:ubuntu-14.04:
  image: ubuntu:trusty
  dependencies:
    - package:ubuntu-14.04
  variables:
    LEVELDB_PKG: libleveldb1
  <<: *debpkg_install

# Xenial

build:ubuntu-16.04:
 <<: *build_definition
 image: ubuntu:xenial
 before_script:
   - apt-get update -y
   - 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

package:ubuntu-16.04:
  image: ubuntu:xenial
  dependencies:
    - build:ubuntu-16.04
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_template

deploy:ubuntu-16.04:
  image: ubuntu:xenial
  dependencies:
    - package:ubuntu-16.04
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_install

# Yakkety

build:ubuntu-16.10:
 <<: *build_definition
 image: ubuntu:yakkety
 before_script:
   - apt-get update -y
   - 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

package:ubuntu-16.10:
  image: ubuntu:yakkety
  dependencies:
    - build:ubuntu-16.10
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_template

deploy:ubuntu-16.10:
  image: ubuntu:yakkety
  dependencies:
    - package:ubuntu-16.10
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_install

# Zesty

build:ubuntu-17.04:
 <<: *build_definition
 image: ubuntu:zesty
 before_script:
   - apt-get update -y
   - 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

package:ubuntu-17.04:
  image: ubuntu:zesty
  dependencies:
    - build:ubuntu-17.04
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_template

deploy:ubuntu-17.04:
  image: ubuntu:zesty
  dependencies:
    - package:ubuntu-17.04
  variables:
    LEVELDB_PKG: libleveldb1v5
  <<: *debpkg_install

##
## Fedora
##

build:fedora-24:
  <<: *build_definition
  image: fedora:24
  before_script:
    - 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