forked from peterbraden/node-opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
105 lines (96 loc) · 3.76 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
# environment variables
environment:
node_pre_gyp_accessKeyId:
secure: 3GHZvq0y83PQ8Qi7FOc5rKoULRQvd2OohhtGqRQLZB4=
node_pre_gyp_secretAccessKey:
secure: AiX8Bx+U8LKu5JZHb5CMth5xOHuWawkQW3il0OFWfV4kodPZnC8dLYIqb4XZeF7f
# try on unstable version of the server to build node-opencv
os: unstable
# to add several platforms to build matrix:
platform:
- x64
install:
- cmd: ECHO "INSTALL OPENCV:"
- cmd: choco install OpenCV
- cmd: ECHO "APPVEYOR_REPO_COMMIT_MESSAGE ->"
- cmd: ECHO %APPVEYOR_REPO_COMMIT_MESSAGE%
- cmd: SET COMMIT_MSG="%APPVEYOR_REPO_COMMIT_MESSAGE%"
- cmd: SET PUBLISH_BINARY=false
# Check to verify the branch is the same than latest tag, if so
# then we publish the binaries if everything else is successful.
- cmd: git describe --tags --always HEAD > _git_tag.tmp
- cmd: SET /p GIT_TAG=<_git_tag.tmp
- cmd: ECHO "LATEST LOCAL TAG:"
- cmd: ECHO %GIT_TAG%
- cmd: ECHO "APPVEYOR REPO BRANCH/TAG:"
- cmd: ECHO %APPVEYOR_REPO_BRANCH%
- cmd: DEL _git_tag.tmp
- cmd: IF x%APPVEYOR_REPO_BRANCH%==x%GIT_TAG% SET PUBLISH_BINARY=true
# Or look for commit message containing `[publish binary]`
- cmd: IF not x%COMMIT_MSG:[publish binary]=%==x%COMMIT_MSG% SET PUBLISH_BINARY=true
- cmd: ECHO "Env Var PUBLISH_BINARY:"
- cmd: ECHO %PUBLISH_BINARY%
- cmd: git clone https://github.com/marcelklehr/nodist.git c:\nodist 2>&1
- cmd: SET PATH=C:\nodist\bin;%PATH%
- cmd: SET NODIST_PREFIX=C:\nodist
before_build:
- cmd: SET ARCH=x64
- cmd: SET NODIST_X64=1
- cmd: call nodist update
- cmd: call nodist stable
- cmd: npm install -g node-gyp
- cmd: SET APP_PATH=%CD%
- cmd: IF EXIST C:\OpenCV* CD C:\OpenCV*
- cmd: SET OPENCV_ROOT_PATH=%CD%\opencv
- cmd: CD %APP_PATH%
- cmd: SET OPENCV_DIR=%OPENCV_ROOT_PATH%\build\%ARCH%\vc12\bin
- cmd: SET PATH=%cd%\node_modules\.bin\;C:\MinGW\bin;C:\GTK\bin;C:\msys\1.0\bin;%OPENCV_DIR%;%PATH%
- cmd: SET PKG_CONFIG_PATH=C:\GTK\lib\pkgconfig
- cmd: DIR %OPENCV_ROOT_PATH%\build\%ARCH%\vc12\bin
- cmd: DIR %OPENCV_ROOT_PATH%\build\%ARCH%\vc12\lib
# Here we need to copy the opencv.pc file from the repo into PKG_CONFIG_PATH
# trick part is to check for the vc12 folder and use that one
- cmd: copy .\utils\opencv_x64.pc C:\GTK\lib\pkgconfig\opencv.pc
# to run your custom scripts instead of automatic MSBuild
build_script:
- cmd: ECHO "BUILDING x64 binary package:"
- cmd: npm install --build-from-source --msvs_version=2013
- cmd: npm test
- cmd: node lib/opencv.js
- cmd: ECHO "PUBLISH x64 binary package:"
- cmd: npm install aws-sdk
- cmd: IF %PUBLISH_BINARY%==true (node-pre-gyp package publish 2>&1)
- cmd: node-pre-gyp clean
- cmd: node-gyp clean
- cmd: npm uninstall -g node-gyp
- cmd: rmdir /q /s node_modules
- cmd: DEL C:\GTK\lib\pkgconfig\opencv.pc
after_build:
- cmd: SET ARCH=x86
- cmd: SET OPENCV_DIR=%OPENCV_ROOT_PATH%\build\%ARCH%\vc12\bin
- cmd: SET PATH=%OPENCV_DIR%;%PATH%
- cmd: SET NODIST_X64=0
- cmd: call nodist update
- cmd: call nodist stable
- cmd: npm install -g node-gyp
- cmd: copy .\utils\opencv_x86.pc C:\GTK\lib\pkgconfig\opencv.pc
- cmd: ECHO "BUILDING x86 binary package:"
- cmd: npm install --build-from-source --msvs_version=2013
- cmd: npm test
- cmd: node lib/opencv.js
- cmd: ECHO "PUBLISH x86 binary package:"
- cmd: npm install aws-sdk
- cmd: IF %PUBLISH_BINARY%==true (node-pre-gyp package publish 2>&1)
- cmd: node-pre-gyp clean
- cmd: node-gyp clean
- cmd: rmdir /q /s node_modules
on_success:
# test installing from binary package works
- cmd: ECHO "ON SUCCESS:"
- cmd: ECHO "Try installing from binary:"
#- cmd: IF %PUBLISH_BINARY%==true npm install --fallback-to-build=false
- cmd: npm install --fallback-to-build=false
# Print Available Binaries
- cmd: node-pre-gyp info
test: OFF
deploy: OFF