appveyor.yml 2.6 KB
Newer Older
1
environment:
2 3 4 5
  USER:
    secure: fXgF9uyy6sT0JoVOR7BoqA==

  PASS:
6
    secure: HHNjmjxQSvgSY9Zde0qh6A==
7

J
Jon Winsley 已提交
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
  matrix:
    - PYTHON: "C:/Python27"
      BUILD_ENV: "Visual Studio 14"
      BUILD_DIR: "build"
      PYTHON_VERSION: "2.7"
    - PYTHON: "C:/Python27-x64"
      BUILD_ENV: "Visual Studio 14 Win64"
      BUILD_DIR: "build64"
      PYTHON_VERSION: "2.7"
    - PYTHON: "C:/Python34"
      BUILD_ENV: "Visual Studio 14"
      BUILD_DIR: "build"
      PYTHON_VERSION: "3.4"
    - PYTHON: "C:/Python34-x64"
      BUILD_ENV: "Visual Studio 14 Win64"
      BUILD_DIR: "build64"
      PYTHON_VERSION: "3.4"
    - PYTHON: "C:/Python35"
      BUILD_ENV: "Visual Studio 14"
      BUILD_DIR: "build"
      PYTHON_VERSION: "3.5"
    - PYTHON: "C:/Python35-x64"
      BUILD_ENV: "Visual Studio 14 Win64"
      BUILD_DIR: "build64"
      PYTHON_VERSION: "3.5"

S
skvark 已提交
34
install:
O
Olli-Pekka Heinisuo 已提交
35
- cmd: >-
S
skvark 已提交
36

37
    git submodule update --init --recursive
38

39
    C:\Python35\python.exe find_version.py
40

J
Jon Winsley 已提交
41
    "%PYTHON%/python.exe" -m pip install --upgrade pip
42

J
Jon Winsley 已提交
43
    "%PYTHON%/python.exe" -m pip install -r requirements.txt
44

S
skvark 已提交
45
build_script:
46
- cmd: |-
O
Olli-Pekka Heinisuo 已提交
47

J
Jon Winsley 已提交
48
    if not exist "%APPVEYOR_BUILD_FOLDER%\opencv\%BUILD_DIR%" mkdir "%APPVEYOR_BUILD_FOLDER%\opencv\%BUILD_DIR%"
49

S
skvark 已提交
50
    cd opencv
51

J
Jon Winsley 已提交
52 53 54 55
    if %PYTHON_VERSION% GEQ 3 cmake -G "%BUILD_ENV%" -H"." -B"%BUILD_DIR%" -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DPYTHON3_EXECUTABLE="%PYTHON%/python.exe" -DPYTHON3_LIBRARY="%PYTHON%/libs/python3*.lib" -DPYTHON3_INCLUDE_DIR="%PYTHON%/include" -Wno-dev
    if %PYTHON_VERSION% LSS 3 cmake -G "%BUILD_ENV%" -H"." -B"%BUILD_DIR%" -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -Wno-dev
    
    cd %BUILD_DIR%
56

S
more cd  
skvark 已提交
57
    cmake --build . --config Release
58

S
spaces  
skvark 已提交
59
    cd ..\..
60
    cd
61

J
Jon Winsley 已提交
62 63 64
    if %PYTHON_VERSION% GEQ 3 xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\%BUILD_DIR%\lib\python3\Release\*.pyd" .\cv2 /I
    if %PYTHON_VERSION% LSS 3 xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\%BUILD_DIR%\lib\RELEASE\*.pyd" .\cv2 /I
    xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\%BUILD_DIR%\bin\Release\*.dll" .\cv2 /I
65

J
Jon Winsley 已提交
66
    dir
S
skvark 已提交
67

J
Jon Winsley 已提交
68
    "%PYTHON%/python.exe" setup.py bdist_wheel
69

O
Olli-Pekka Heinisuo 已提交
70 71 72
before_test:
- cmd: >-

O
Olli-Pekka Heinisuo 已提交
73 74
    cd ..

J
Jon Winsley 已提交
75
    "%PYTHON%/python.exe" -m pip install --no-index --find-links=%APPVEYOR_BUILD_FOLDER%\dist\ opencv-python
76

O
Olli-Pekka Heinisuo 已提交
77 78
test_script:
- cmd: >-
79

O
Olli-Pekka Heinisuo 已提交
80
    cd %APPVEYOR_BUILD_FOLDER%\tests
O
Olli-Pekka Heinisuo 已提交
81

J
Jon Winsley 已提交
82
    "%PYTHON%/python.exe" -m unittest test
O
Olli-Pekka Heinisuo 已提交
83

S
skvark 已提交
84 85
artifacts:
- path: dist\*.whl
O
Olli-Pekka Heinisuo 已提交
86
  name: wheels
87 88

deploy_script:
89
- cd %APPVEYOR_BUILD_FOLDER%
90
- if "%APPVEYOR_REPO_TAG%"=="true" (python -m twine upload -u %USER% -p %PASS% --skip-existing dist/opencv*) else (echo "Tag not set, deployment skipped.")