forked from dmorissette/mapserver
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
114 lines (99 loc) · 5.83 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
branches:
except:
- /(cherry-pick-)?backport-\d+-to-/
image: Visual Studio 2017
cache:
- '%LOCALAPPDATA%\pip\Cache'
- '%APPVEYOR_BUILD_FOLDER%\swigwin-3.0.12.zip'
- '%APPVEYOR_BUILD_FOLDER%\swigwin-4.0.1.zip'
environment:
global:
TWINE_USERNAME: mapserver
TWINE_PASSWORD:
secure: mHoJHeXdXbBNoDf7MA4ZEg==
# VS 2017
VS_VERSION: Visual Studio 15 2017
matrix:
- platform: x86
PYTHON_EXECUTABLE: c:/python27/python.exe
SWIG_VER: swigwin-3.0.12
- platform: x64
PYTHON_EXECUTABLE: c:/python27-x64/python.exe
SWIG_VER: swigwin-4.0.1
- platform: x64
PYTHON_EXECUTABLE: c:/python36-x64/python.exe
SWIG_VER: swigwin-4.0.1
services:
- mssql2017
matrix:
fast_finish: true
shallow_clone: false
clone_depth: 5
build_script:
- set "BUILD_FOLDER=%APPVEYOR_BUILD_FOLDER:\=/%"
- if "%platform%" == "x64" SET VS_FULL=%VS_VERSION% Win64
- if "%platform%" == "x86" SET VS_FULL=%VS_VERSION%
- if "%platform%" == "x86" SET SDK=release-1911
- if "%platform%" == "x64" SET SDK=release-1911-x64
- if "%platform%" == "x64" call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat"
- if "%platform%" == "x86" call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars32.bat"
- echo "%VS_FULL%"
- if not exist %SWIG_VER%.zip appveyor DownloadFile https://sourceforge.net/projects/swig/files/swigwin/%SWIG_VER%/%SWIG_VER%.zip
- set SDK_ZIP=%SDK%-dev.zip
- set SDK_URL=http://download.gisinternals.com/sdk/downloads/%SDK_ZIP%
- echo "%SDK_ZIP%"
- echo "%SDK_URL%"
- mkdir sdk
- 7z x %SWIG_VER%.zip -osdk > nul
- cd sdk
- appveyor DownloadFile "%SDK_URL%"
- 7z x "%SDK_ZIP%" > nul
- set SDK_PREFIX=%BUILD_FOLDER%/sdk/%SDK%
- set SDK_INC=%BUILD_FOLDER%/sdk/%SDK%/include
- set SDK_LIB=%BUILD_FOLDER%/sdk/%SDK%/lib
- set SDK_BIN=%BUILD_FOLDER%/sdk/%SDK%/bin
- set SWIG_EXECUTABLE=%BUILD_FOLDER%/sdk/%SWIG_VER%/swig.exe
- set REGEX_DIR=%BUILD_FOLDER%/sdk/regex-0.12
- cd %BUILD_FOLDER%
- mkdir build
- cd build
- set "PROJECT_BINARY_DIR=%BUILD_FOLDER%/build"
- cmake -G "%VS_FULL%" .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%SDK_PREFIX% -DFREETYPE_INCLUDE_DIR_freetype2=%SDK_INC%/freetype -DFREETYPE_INCLUDE_DIR_ft2build=%SDK_INC%/freetype -DFREETYPE_LIBRARY=%SDK_LIB%/freetype.lib -DZLIB_INCLUDE_DIR=%SDK_INC% -DZLIB_LIBRARY=%SDK_LIB%/zlib.lib -DPNG_PNG_INCLUDE_DIR=%SDK_INC% -DPNG_LIBRARY=%SDK_LIB%/libpng.lib -DPNG_LIBRARIES=%SDK_LIB%/libpng.lib -DJPEG_INCLUDE_DIR=%SDK_INC% -DJPEG_LIBRARY=%SDK_LIB%/libjpeg.lib -DPROJ_INCLUDE_DIR=%SDK_INC% -DPROJ_LIBRARY=%SDK_LIB%/proj_i.lib -DFRIBIDI_INCLUDE_DIR=%SDK_INC% -DFRIBIDI_LIBRARY=%SDK_LIB%/fribidi.lib -DHARFBUZZ_INCLUDE_DIR=%SDK_INC%/harfbuzz -DHARFBUZZ_LIBRARY=%SDK_LIB%/harfbuzz.lib -DICONV_INCLUDE_DIR=%SDK_INC% -DICONV_LIBRARY=%SDK_LIB%/iconv.lib -DICONV_DLL=%SDK_BIN%/iconv.dll -DCAIRO_INCLUDE_DIR=%SDK_INC% -DCAIRO_LIBRARY=%SDK_LIB%/cairo.lib -DFCGI_INCLUDE_DIR=%SDK_INC% -DFCGI_LIBRARY=%SDK_LIB%/libfcgi.lib -DGEOS_INCLUDE_DIR=%SDK_INC% -DGEOS_LIBRARY=%SDK_LIB%/geos_c.lib -DPOSTGRESQL_INCLUDE_DIR=%SDK_INC% -DPOSTGRESQL_LIBRARY=%SDK_LIB%/libpqdll.lib -DGDAL_INCLUDE_DIR=%SDK_INC% -DGDAL_LIBRARY=%SDK_LIB%/gdal_i.lib -DLIBXML2_INCLUDE_DIR=%SDK_INC%/libxml -DLIBXML2_LIBRARIES=%SDK_LIB%/libxml2.lib -DGIF_INCLUDE_DIR=%SDK_INC% -DGIF_LIBRARY=%SDK_LIB%/giflib.lib -DWITH_CURL=1 -DCURL_INCLUDE_DIR=%SDK_INC% -DCURL_LIBRARY=%SDK_LIB%/libcurl_imp.lib -DMS_EXTERNAL_LIBS=wsock32.lib -DWITH_SOS=1 -DWITH_CLIENT_WFS=1 -DWITH_CLIENT_WMS=1 -DSVG_INCLUDE_DIR=%SDK_INC% -DSVG_LIBRARY=%SDK_LIB%/libsvg.lib -DSVGCAIRO_INCLUDE_DIR=%SDK_INC% -DSVGCAIRO_LIBRARY=%SDK_LIB%/libsvg-cairo.lib -DWITH_SVGCAIRO=1 -DREGEX_DIR=%REGEX_DIR% -DWITH_POINT_Z_M=1 -DWITH_KML=1 -DWITH_THREAD_SAFETY=1 -DSWIG_EXECUTABLE=%SWIG_EXECUTABLE% -DWITH_PYTHON=1 -DPYTHON_EXECUTABLE=%PYTHON_EXECUTABLE% -DWITH_CSHARP=1 -DWITH_MSSQL2008=1 -DPROTOBUFC_COMPILER=%SDK_BIN%/protoc.exe -DPROTOBUFC_LIBRARY=%SDK_LIB%/protobuf-c.lib -DPROTOBUFC_INCLUDE_DIR=%SDK_INC%/include/protobuf-c -DWITH_PROTOBUFC=1 -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX"
- cmake --build . --config Release
- cd %BUILD_FOLDER%/build
- set PATH=%BUILD_FOLDER%/build/Release;%SDK_BIN%;%PATH%
- set PROJ_LIB=%SDK_BIN%/proj/SHARE
- cmake --build . --target pythonmapscript-wheel --config Release
before_test:
- set PATH=%PATH%;%SDK_BIN%/gdal/apps
- cd %BUILD_FOLDER%/msautotest
- set PROJ_LIB=%SDK_BIN%/proj6/share
- "./mssql/create_mssql_db.bat"
- "%PYTHON_EXECUTABLE% -m pip install -U -r requirements.txt"
- "%PYTHON_EXECUTABLE% -m pip install --no-index --find-links=file://%BUILD_FOLDER%/build/mapscript/python/Release/dist mapscript"
test_script:
- set PROJ_LIB=%SDK_BIN%/proj/SHARE
- cd %BUILD_FOLDER%/msautotest/mssql
- "%PYTHON_EXECUTABLE% run_test.py"
- cd %BUILD_FOLDER%/msautotest/mspython
- "%PYTHON_EXECUTABLE% run_all_tests.py"
after_test:
- cd %BUILD_FOLDER%
- 7z a mapserver.zip ./build/* > nul
# Uncomment to enable debugging on the server
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
artifacts:
- path: mapserver.zip
name: mapserver
type: zip
deploy_script:
- ps: |
if ($env:APPVEYOR_REPO_BRANCH -ne "master" -or $env:APPVEYOR_REPO_TAG -ne $TRUE) { return }
if ($env:PYTHON_EXECUTABLE -eq "c:/python36-x64/python.exe") {
cd $env:APPVEYOR_BUILD_FOLDER\build\mapscript\python\Release
& $env:PYTHON_EXECUTABLE setup.py sdist
}
echo "Deploying Python Wheel to PyPI"
& $env:PYTHON_EXECUTABLE -m pip --disable-pip-version-check install twine
& $env:PYTHON_EXECUTABLE -m twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing $env:APPVEYOR_BUILD_FOLDER\build\mapscript\python\Release\dist\*