forked from Sphereserver/Source-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
204 lines (167 loc) · 7.66 KB
/
appveyor.yml
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
# Do not build on tags (GitHub only)
skip_tags: true
# Do not increment the current build number after each automatic build
#pull_requests:
# do_not_increment_build_number: true
# Branches to build
branches:
only:
- master
# Version format
version: 1.1.0.{build}
# Set up two building environments (two first class elements in the build matrix)
image:
- Visual Studio 2017
- Ubuntu
- macos
# Environmental variables
environment:
# Common to all the builds of the matrix
BUILD_DIR_32: build-32
BUILD_DIR_64: build-64
FTP_USER:
secure: zkxiTiVr5wfmALN6TjuhfQ==
FTP_PASSWORD:
secure: C21uMb7NoO6R6ILqDeVqrY3W+6Jap5PFqLgUt65BEzU=
FTP_SERVER:
secure: ypUVoKvq2e+1urlrXABB5r5XsWuxKXWmvlJpQEe4iNw=
# Build scripts
for:
- # Windows build
matrix:
only:
- image: Visual Studio 2017
environment:
MSBUILD_FLAGS: /verbosity:minimal /maxcpucount
CMAKE_GEN_32: Visual Studio 15 2017
CMAKE_GEN_64: Visual Studio 15 2017 Win64
install:
# Report our building tools
- msbuild /version
- cmake --version
# Use our custom script instead of automatic MSBuild
build_script:
- mkdir %BUILD_DIR_32% %BUILD_DIR_64%
- cd "%BUILD_DIR_64%"
- IF DEFINED APPVEYOR_PULL_REQUEST_NUMBER (
ECHO. && ECHO ** Starting to build 64 bits Nightly version to test the Pull Request && ECHO.
) ELSE (
ECHO. $$ECHO ** Starting to build 64 bits Nightly version && ECHO.
)
- cmake -G "%CMAKE_GEN_64%" ..\src
- msbuild SphereServer.sln %MSBUILD_FLAGS% /p:Configuration=Nightly
- ECHO. && ECHO ** End of the compilation of the 64 bits Nightly version && ECHO.
# if we are testing a pull request, building only a version will be sufficient, so stop this script
- IF DEFINED APPVEYOR_PULL_REQUEST_NUMBER (appveyor exit)
- cd "..\%BUILD_DIR_32%"
- ECHO. && ECHO ** Starting to build 32 bits Nightly version && ECHO.
- cmake -G "%CMAKE_GEN_32%" ..\src
- msbuild SphereServer.sln %MSBUILD_FLAGS% /p:Configuration=Nightly
- ECHO. && ECHO ** End of the compilation of the 32 bits Nightly version && ECHO.
- cd ..
after_build:
# if we are testing a pull request, we don't want to upload the build to the host
- IF DEFINED APPVEYOR_PULL_REQUEST_NUMBER (appveyor exit)
- ECHO ** Compilation done. Packing the files and uploading to SphereCommunity
- mkdir accounts logs save scripts
- 7z a SphereSvrX-win64-nightly.zip accounts\ logs\ save\ scripts\ "%APPVEYOR_BUILD_FOLDER%\%BUILD_DIR_64%\bin64\Nightly\SphereSvrX64_nightly.exe" "%APPVEYOR_BUILD_FOLDER%\src\sphere.ini" "%APPVEYOR_BUILD_FOLDER%\src\sphereCrypt.ini" "%APPVEYOR_BUILD_FOLDER%\dlls\64\libmysql.dll"
- 7z a SphereSvrX-win32-nightly.zip accounts\ logs\ save\ scripts\ "%APPVEYOR_BUILD_FOLDER%\%BUILD_DIR_32%\bin\Nightly\SphereSvrX32_nightly.exe" "%APPVEYOR_BUILD_FOLDER%\src\sphere.ini" "%APPVEYOR_BUILD_FOLDER%\src\sphereCrypt.ini" "%APPVEYOR_BUILD_FOLDER%\dlls\32\libmysql.dll"
- curl -sST "{SphereSvrX-win64-nightly.zip,SphereSvrX-win32-nightly.zip}" -u %FTP_USER%:%FTP_PASSWORD% %FTP_SERVER%
artifacts:
- path: SphereSvrX-win64-nightly.zip
- path: SphereSvrX-win32-nightly.zip
- # Linux build
matrix:
only:
- image: Ubuntu
environment:
CMAKE_GEN: Unix Makefiles
CMAKE_TCH_32: ../src/cmake/toolchains/Linux-GNU-x86.cmake
CMAKE_TCH_64: ../src/cmake/toolchains/Linux-GNU-x86_64.cmake
install:
- echo && echo "** Setting up GCC compiler" && echo
- sudo apt-get -qq update
- sudo apt install -yqq --no-install-recommends gcc-7 gcc-7-multilib g++-7 g++-7-multilib > /dev/null
- export CC="gcc-7" && export CXX="g++-7"
# Report our building tools
- lsb_release -d
- gcc --version
- cmake --version
# Use our custom script
build_script:
- echo && echo "** Setting up MySQL development packages for 64 bits" && echo
- sudo apt install -yqq --no-install-recommends curl libmysql++-dev > /dev/null
- mkdir "$BUILD_DIR_32" "$BUILD_DIR_64"
- cd "$BUILD_DIR_64"
- |-
if [ -n "${APPVEYOR_PULL_REQUEST_NUMBER}" ]; then
echo && echo "** Starting to build 64 bits Nightly version to test the Pull Request" && echo
else
echo && echo "** Starting to build 64 bits Nightly version" && echo
fi
- cmake -G "$CMAKE_GEN" -DCMAKE_BUILD_TYPE="Nightly" -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH_64" ../src
- make -j4 || exit 1 # if the build fails, stop here
- echo && echo "** End of the compilation of the 64 bits Nightly version" && echo
# if we are testing a pull request, building only a version will be sufficient, so stop this script
- |-
if [ -n "${APPVEYOR_PULL_REQUEST_NUMBER}" ]; then
exit 0
fi
- cd ..
- echo && echo "** Setting up MySQL development packages for 32 bits" && echo
- sudo apt remove -yqq libmysql++-dev > /dev/null
- sudo apt install -yqq --no-install-recommends libmysql++-dev:i386 > /dev/null
- export CC="gcc-7" && export CXX="g++-7"
- cd "$BUILD_DIR_32"
- echo && echo "** Starting to build 32 bits Nightly version" && echo
- cmake -G "$CMAKE_GEN" -DCMAKE_BUILD_TYPE="Nightly" -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH_32" ../src
- make -j4 || exit 1 # if the build fails, stop here
- echo && echo "** End of the compilation of the 32 bits Nightly version" && echo
- cd ..
after_build:
# if we are testing a pull request, we don't want to upload the build to the host
- |-
if [ -n "${APPVEYOR_PULL_REQUEST_NUMBER}" ]; then
exit 0
fi
- echo && echo "** Compilation done. Packing the files and uploading to SphereCommunity" && echo
- mkdir accounts logs save scripts
- tar -czf SphereSvrX-linux64-nightly.tar.gz accounts/ logs/ save/ scripts/ "${BUILD_DIR_64}/bin64/SphereSvrX64_nightly" -C src/ sphere.ini sphereCrypt.ini
- tar -czf SphereSvrX-linux32-nightly.tar.gz accounts/ logs/ save/ scripts/ "${BUILD_DIR_32}/bin/SphereSvrX32_nightly" -C src/ sphere.ini sphereCrypt.ini
- curl -sST "{SphereSvrX-linux64-nightly.tar.gz,SphereSvrX-linux32-nightly.tar.gz}" -u ${FTP_USER}:${FTP_PASSWORD} ${FTP_SERVER}
artifacts:
- path: SphereSvrX-linux64-nightly.tar.gz
- path: SphereSvrX-linux32-nightly.tar.gz
- # OSX build
matrix:
only:
- image: macos
install:
- echo && echo "** Setting up compiler" && echo
- export HOMEBREW_NO_AUTO_UPDATE=1
- brew install ninja mysql-client
- gcc -v && g++ -v && cmake --version
# Use our custom script
build_script:
- echo && echo "** Starting to build 64 bits Nightly version" && echo
- mkdir -p "$BUILD_DIR_64"
- cd "$BUILD_DIR_64"
- cmake -G Ninja ../src -DCMAKE_BUILD_TYPE="Nightly" && cmake --build . || exit 1
- cd ..
after_build:
# if we are testing a pull request, we don't want to upload the build to the host
- |-
if [ -n "${APPVEYOR_PULL_REQUEST_NUMBER}" ]; then
exit 0
fi
- echo && echo "** Compilation done. Packing the files and uploading to SphereCommunity" && echo
- mkdir accounts logs save scripts
- zip -r SphereSvrX-osx64-nightly.zip accounts/ logs/ save/ scripts/
- cd src/
- zip ../SphereSvrX-osx64-nightly.zip sphere.ini sphereCrypt.ini
- cd "../${BUILD_DIR_64}/bin64"
- zip -r ../../SphereSvrX-osx64-nightly.zip *
- cd ../../
- curl -sST "{SphereSvrX-osx64-nightly.zip}" -u ${FTP_USER}:${FTP_PASSWORD} ${FTP_SERVER}
artifacts:
- path: SphereSvrX-osx64-nightly.zip