-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathci-build.sh
97 lines (50 loc) · 1.62 KB
/
ci-build.sh
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
#!/bin/sh
# fail on error
set -e
# add testing repository
echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
# update apk cache
apk --no-cache update
apk --no-cache upgrade
# install runtime dependencies
apk add libc++ curl libssl1.0 libunwind libstdc++ zlib
# install compile-time dependencies
apk add --no-cache --virtual .dev-deps libc++-dev curl-dev clang clang-dev build-base linux-headers openssl-dev python2 py2-pip lua5.3 lua5.3-dev mono-dev
# install ply
pip install ply
# download and build premake
curl -sLo /tmp/premake.zip https://github.com/premake/premake-core/releases/download/v5.0.0-alpha11/premake-5.0.0-alpha11-src.zip
pushd /tmp
unzip -q premake.zip
rm premake.zip
cd premake-*
cd build/gmake.unix/
make -j4
cd ../../
mv bin/release/premake5 /usr/local/bin
cd ..
rm -rf premake-*
# download and extract boost
echo "Downloading Boost"
curl -sLo /tmp/boost.tar.bz2 https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2
echo "Extracting Boost"
tar xf boost.tar.bz2
rm boost.tar.bz2
mv boost_* boost
export BOOST_ROOT=/tmp/boost/
# build CitizenFX
popd
cd code
cp -a ../vendor/curl/include/curl/curlbuild.h.dist ../vendor/curl/include/curl/curlbuild.h
premake5 gmake --game=server --cc=clang --dotnet=msnet
echo '#pragma once' > shared/cfx_version.h
echo '#define GIT_DESCRIPTION "'$CI_BUILD_REF_NAME' v1.0.0.'$CI_PIPELINE_ID' linux"' >> shared/cfx_version.h
cd build/server/linux
export CXXFLAGS="-std=c++1z -stdlib=libc++"
make clean
make clean config=release
make -j4 config=release
cd ../../../
# clean up
rm -rf /tmp/boost
apk del .dev-deps