-
Notifications
You must be signed in to change notification settings - Fork 40
/
appveyor.yml
218 lines (174 loc) · 8.42 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# AppVeyor workflows for SphereServer-X.
# Used to build and upload on the website only nightlies on a new commit.
# We use Github workflows to build both nightlies and pull requests.
# 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 2022
- Ubuntu2004
- macos-monterey
# 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 17 2022
CMAKE_GEN_64: Visual Studio 17 2022 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%" -S ..\ -B .
- msbuild SphereServer.sln %MSBUILD_FLAGS% /maxcpucount /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%" -S ..\ -B .
- msbuild SphereServer.sln %MSBUILD_FLAGS% /maxcpucount /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%\bin-x86_64\Nightly\SphereSvrX64_nightly.exe"
"%APPVEYOR_BUILD_FOLDER%\src\sphere.ini" "%APPVEYOR_BUILD_FOLDER%\src\sphereCrypt.ini" "%APPVEYOR_BUILD_FOLDER%\lib\bin\x86_64\mariadb\libmariadb.dll"
- 7z a SphereSvrX-win32-nightly.zip accounts\ logs\ save\ scripts\ "%APPVEYOR_BUILD_FOLDER%\%BUILD_DIR_32%\bin-x86\Nightly\SphereSvrX32_nightly.exe"
"%APPVEYOR_BUILD_FOLDER%\src\sphere.ini" "%APPVEYOR_BUILD_FOLDER%\src\sphereCrypt.ini" "%APPVEYOR_BUILD_FOLDER%\lib\bin\x86\mariadb\libmariadb.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: Ninja
CMAKE_TCH_32: cmake/toolchains/Linux-GNU-x86.cmake
CMAKE_TCH_64: cmake/toolchains/Linux-GNU-x86_64.cmake
install:
- lsb_release -d
- echo && echo "** Setting up GCC compiler" && echo
- sudo add-apt-repository universe && sudo apt-get -qq update
- sudo apt install -yq --no-install-recommends curl linux-libc-dev:i386 gcc-12 gcc-12-multilib g++-12 g++-12-multilib > /dev/null
#- export CC="gcc-9" && export CXX="g++-9"
#- sudo apt install -yqq --no-install-recommends ninja-build linux-libc-dev:i386 gcc-12 gcc-12-multilib g++-12 g++-12-multilib > /dev/null
#- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 --slave /usr/bin/g++ g++ /usr/bin/g++-12
# Report our building tools
- gcc -v && cmake --version && ninja --version
# Use our custom script
build_script:
- echo && echo "** Setting up MariaDB packages for x86_64 arch (64 bits)" && echo
- sudo apt install -yq --no-install-recommends libmariadb3 libmariadb-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" -S ../ -B .
- ninja || 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 MariaDB packages for x86 arch (32 bits)" && echo
#- sudo apt remove -yq libmariadb3 > /dev/null
- sudo apt install -yq --no-install-recommends libmariadb3:i386 libmariadb-dev:i386 > /dev/null
- 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" -S ../ -B .
- ninja || 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}/bin-x86_64/SphereSvrX64_nightly" -C src/ sphere.ini sphereCrypt.ini
- tar -czf SphereSvrX-linux32-nightly.tar.gz accounts/ logs/ save/ scripts/ "${BUILD_DIR_32}/bin-x86/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-monterey
environment:
CMAKE_GEN: Ninja
CMAKE_TCH_64: cmake/toolchains/OSX-AppleClang-x86_64.cmake
install:
- sw_vers
- echo && echo "** Setting up compiler" && echo
- export HOMEBREW_NO_AUTO_UPDATE=1
- export HOMEBREW_NO_INSTALL_CLEANUP=1
- brew install ninja mariadb-connector-c
- gcc -v && cmake --version && ninja --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 $CMAKE_GEN -DCMAKE_BUILD_TYPE="Nightly" -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH_64" -S ../ -B .
- ninja || exit 1 # if the build fails, stop here
- 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-osx-x86_64-nightly.zip accounts/ logs/ save/ scripts/
- zip -r SphereSvrX-osx-x86_64-nightly.zip src/sphere.ini src/sphereCrypt.ini "${BUILD_DIR_64}/bin-x86_64/*"
- curl -sST "{SphereSvrX-osx-x86_64-nightly.zip}" -u ${FTP_USER}:${FTP_PASSWORD} ${FTP_SERVER}
artifacts:
- path: SphereSvrX-osx-x86_64-nightly.zip