forked from MapServer/MapServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
134 lines (119 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
branches:
except:
- /(cherry-pick-)?backport-\d+-to-/
image: Visual Studio 2019
cache:
- '%LOCALAPPDATA%\pip\Cache'
- '%APPVEYOR_BUILD_FOLDER%\swigwin-3.0.12.zip'
- '%APPVEYOR_BUILD_FOLDER%\swigwin-4.0.2.zip'
environment:
global:
SWIG_VER: swigwin-4.0.2
TWINE_USERNAME: mapserver
TWINE_PASSWORD:
secure: mHoJHeXdXbBNoDf7MA4ZEg==
# VS 2019
VS_VERSION: Visual Studio 16 2019
matrix:
- platform: x86
Python_ROOT_DIR: c:/python27
SWIG_VER: swigwin-3.0.12
- platform: x64
Python_ROOT_DIR: c:/python27-x64
- platform: x64
Python_ROOT_DIR: c:/python36-x64
- platform: x64
Python_ROOT_DIR: c:/python37-x64
- platform: x64
Python_ROOT_DIR: c:/python38-x64
matrix:
fast_finish: true
shallow_clone: false
clone_depth: 5
init:
- net start MSSQL$SQL2019
- ps: |
if ($env:APPVEYOR_REPO_TAG -ne $TRUE) {
if ("c:/python27-x64","c:/python36-x64" -contains $env:Python_ROOT_DIR -eq $TRUE) {
Write-Host "Skipping build, not a tagged release."
Exit-AppVeyorBuild
}
}
build_script:
- ps: Write-Host "Build tags - $env:APPVEYOR_REPO_TAG $env:APPVEYOR_REPO_TAG_NAME"
- rename C:\Python310 Python310_Ignore
- set "BUILD_FOLDER=%APPVEYOR_BUILD_FOLDER:\=/%"
- if "%platform%" == "x64" SET VS_FULL=%VS_VERSION%
- if "%platform%" == "x64" SET VS_ARCH=x64
- if "%platform%" == "x86" SET VS_FULL=%VS_VERSION%
- if "%platform%" == "x86" SET VS_ARCH=Win32
- if "%platform%" == "x86" SET SDK=release-1928
- if "%platform%" == "x64" SET SDK=release-1928-x64
- if "%platform%" == "x64" call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvars64.bat"
- if "%platform%" == "x86" call "C:/Program Files (x86)/Microsoft Visual Studio/2019/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%
- mkdir sdk
- 7z x %SWIG_VER%.zip -osdk > nul
# add custom swig.exe
- appveyor DownloadFile http://download.osgeo.org/mapserver/docs/swigwin-4.0.2.mapserver.zip
- cd sdk
- appveyor DownloadFile "%SDK_URL%"
- 7z x "%SDK_ZIP%" > nul
- cd %BUILD_FOLDER%/sdk/%SWIG_VER%/
- if "%platform%" == "x64" 7z e %BUILD_FOLDER%/swigwin-4.0.2.mapserver.zip -y -r swig.exe > 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/support/regex-0.12
- cd %BUILD_FOLDER%
- mkdir build
- cd build
- set PATH=%BUILD_FOLDER%/build/Release;%SDK_BIN%;%PATH%
- set "PROJECT_BINARY_DIR=%BUILD_FOLDER%/build"
- cmake -G "%VS_FULL%" -A %VS_ARCH% .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%SDK_PREFIX% -DPNG_LIBRARY=%SDK_LIB%/libpng16_static.lib -DHARFBUZZ_INCLUDE_DIR=%SDK_INC%/harfbuzz -DICONV_DLL=%SDK_BIN%/iconv.dll -DFRIBIDI_INCLUDE_DIR=%SDK_INC%/fribidi -DMS_EXTERNAL_LIBS=%SDK_LIB%/harfbuzz.lib;%SDK_LIB%/uriparser.lib -DSVG_LIBRARY=%SDK_LIB%/libsvg.lib -DSVGCAIRO_LIBRARY=%SDK_LIB%/libsvg-cairo.lib -DREGEX_DIR=%REGEX_DIR% -DSWIG_EXECUTABLE=%SWIG_EXECUTABLE% -DPROTOBUFC_COMPILER=%SDK_BIN%/protoc.exe -DPROTOBUFC_LIBRARY=%SDK_LIB%/protobuf-c.lib -DPROTOBUFC_INCLUDE_DIR=%SDK_INC%/protobuf-c -DWITH_CURL=1 -DWITH_KML=1 -DWITH_SVGCAIRO=1 -DWITH_THREAD_SAFETY=1 -DWITH_SOS=1 -DWITH_CLIENT_WFS=1 -DWITH_CLIENT_WMS=1-DWITH_CSHARP=1 -DWITH_PROTOBUFC=1 -DWITH_POSTGIS=0 -DWITH_PERL=0 -DWITH_MSSQL2008=1 -DWITH_PYTHON=1 -DWITH_PHPNG=0 -DWITH_HARFBUZZ=1 -DMAPSCRIPT_PROPERTYANNOTATIONS=1 -DPROJ_INCLUDE_DIR=%SDK_INC%/proj7
- cmake --build . --config Release
- cd %BUILD_FOLDER%/build
# set the MapScript custom environment variable for py 3.8
- set MAPSERVER_DLL_PATH=%BUILD_FOLDER%/build/Release;%SDK_BIN%
- set PROJ_LIB=%SDK_BIN%/proj7/SHARE
# check the mapserver exe can run
- mapserv -v
- cmake --build . --target pythonmapscript-wheel --config Release
before_test:
- set PATH=%PATH%;%SDK_BIN%/gdal/apps
- cd %BUILD_FOLDER%/msautotest
- "./mssql/create_mssql_db.bat"
- "%Python_ROOT_DIR%/python -m pip install -U -r requirements.txt"
- "%Python_ROOT_DIR%/python -m pip install --no-index --find-links=file://%BUILD_FOLDER%/build/mapscript/python/Release/dist mapscript"
test_script:
- set PROJ_LIB=%SDK_BIN%/proj7/SHARE
- cd %BUILD_FOLDER%/msautotest/mssql
- "%Python_ROOT_DIR%/python run_test.py"
- cd %BUILD_FOLDER%/msautotest/mspython
- "%Python_ROOT_DIR%/python 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_TAG -ne $TRUE -or ($env:APPVEYOR_REPO_TAG_NAME -cSplit "-").Count -ne 4) { return }
if ($env:Python_ROOT_DIR -eq "c:/python36-x64") {
Write-Host "Deploying Python source distribution to PyPI. Tag $env:APPVEYOR_REPO_TAG_NAME"
cd $env:APPVEYOR_BUILD_FOLDER\build\mapscript\python\Release
& "$env:Python_ROOT_DIR/python" setup.py sdist
}
Write-Host "Deploying Python Wheel to PyPI. Tag $env:APPVEYOR_REPO_TAG_NAME"
& "$env:Python_ROOT_DIR/python" -W ignore -m pip --disable-pip-version-check install twine
& "$env:Python_ROOT_DIR/python" -m twine upload --repository-url https://upload.pypi.org/legacy/ --skip-existing $env:APPVEYOR_BUILD_FOLDER\build\mapscript\python\Release\dist\*