-
Notifications
You must be signed in to change notification settings - Fork 18
/
appveyor.yml
115 lines (85 loc) · 4.64 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
# Build worker image (VM template)
image: Visual Studio 2017
# scripts that are called at very beginning, before repo cloning
init:
- date /T & time /T
- git config --global core.autocrlf input
- cmake --version
#branches:
# only:
# - master
clone_depth: 5
version: '{build}'
platform:
- x64
configuration:
- Release
environment:
MSBUILD_FLAGS: /verbosity:minimal /maxcpucount
matrix:
- generator: "Visual Studio 15 2017 Win64"
matrix:
fast_finish: true
#cache:
# - C:\projects\occ-csg\
install:
- vswhere -property installationPath
# find installation dir, replacement for %VS150COMNTOOLS%
- |-
REM crappy windows batch replacement for bash's var=`mycommand`
for /f "usebackq tokens=*" %%a in (`vswhere -property installationPath`) do set InstallDir=%%a
echo %InstallDir%\VC\Auxiliary\Build\
dir "%InstallDir%\VC\Auxiliary\Build\"
REM if exist "%InstallDir%\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt" (
set /p RedistVersion=<"%InstallDir%\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt"
REM )
echo "%InstallDir%\VC\Redist\MSVC\%RedistVersion%\"
dir "%InstallDir%\VC\Redist\MSVC\%RedistVersion%\"
set "REDIST_DIR=%InstallDir%\VC\Redist\MSVC\%RedistVersion%\"
- echo %VS150COMNTOOLS%
# download OCC
- curl -LfsS -o opencascade-v7.4.0-windows-x64.zip https://github.com/miho/occ-for-occ-csg/releases/download/v7.4.0/opencascade-v7.4.0-windows-x64.zip
- cmd.exe '/C 7z x "opencascade-v7.4.0-windows-x64.zip" -o%APPVEYOR_BUILD_FOLDER%\ -y > nul
- dir %APPVEYOR_BUILD_FOLDER%\opencascade-v7.4.0-windows-x64
build_script:
- cd %APPVEYOR_BUILD_FOLDER%
#- dir
## create folder for an out-of-source-tree build: "c:\projects\build"
#- cd..
- if not exist build mkdir build
- cd build
# generate build script
- cmake .. -G "%generator%" -DOpenCASCADE_DIR=%APPVEYOR_BUILD_FOLDER%\opencascade-v7.4.0-windows-x64\cmake
- MSBuild .\occ-csg-prj.sln /property:Configuration=Release /property:Platform=x64
- bin\Release\occ-csg.exe --help
after_build:
# create folder structure for release
- if not exist %APPVEYOR_BUILD_FOLDER%\release mkdir %APPVEYOR_BUILD_FOLDER%\release
- if not exist %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64 mkdir %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64
- if not exist %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin mkdir %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
# copy redist dlls to release folder
- dir "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\"
- echo "%REDIST_DIR%\x64\"
- dir "%REDIST_DIR%\x64\"
- cp "%REDIST_DIR%\x64\Microsoft.VC141.CRT\vcruntime140.dll" %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
- cp "%REDIST_DIR%\x64\Microsoft.VC141.CRT\vccorlib140.dll" %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
- cp "%REDIST_DIR%\x64\Microsoft.VC141.CRT\msvcp140.dll" %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
- cp "%REDIST_DIR%\x64\Microsoft.VC141.CRT\concrt140.dll" %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
- cp "%REDIST_DIR%\x64\Microsoft.VC141.OpenMP\vcomp140.dll" %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
# copy README and LICENSE files to release folder
- cp %APPVEYOR_BUILD_FOLDER%\LICENSE %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64
- cp %APPVEYOR_BUILD_FOLDER%\THIRDPARTY-LICENSES %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64
- cp %APPVEYOR_BUILD_FOLDER%\README.md %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64
- cp %APPVEYOR_BUILD_FOLDER%\build\bin\Release\occ-csg.exe %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\bin
# package the release
- 7z a -tzip %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64.zip %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64\
# push final release archive as artifact
- appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64.zip
deploy:
- provider: GitHub
name: production
on:
appveyor_repo_tag: true
auth_token:
secure: R+KuFwD7fxyhPRJUEDg4raWGX1H4NZiEN1LM74aADv8pCa3Rz0CXzKBixMK8gxwQ
# artifact: %APPVEYOR_BUILD_FOLDER%\release\occ-csg-%APPVEYOR_REPO_TAG_NAME%-windows-x64.zip