forked from htm-community/htm.core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
151 lines (115 loc) · 4.46 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#---------------------------------#
# general configuration #
#---------------------------------#
image: Visual Studio 2017
configuration: Release
platform: x64
build:
parallel: true
verbosity: minimal
# version format
version: 2.0.0-{build}
branches:
only:
- master
- /^v.*\..*\..*$/ #regexp for tags "v*.*.*", eg v2.0.1-pre
skip_commits:
# Add [av skip] to commit messages to skip AppVeyor building
# Add [ci skip] to skip Travis and AppVeyor building
message: /\[av skip\]/
# Do not build feature branch with open Pull Requests
# prevents two builds when a PR is pushed.
skip_branch_with_pr: true
#---------------------------------#
# environment configuration #
#---------------------------------#
# https://www.appveyor.com/docs/environment-variables
# https://www.appveyor.com/docs/installed-software
init:
- git config --global core.autocrlf input
clone_folder: c:\projects\htm-core
clone_depth: 1
# Can't have a shallow clone because the CMake process will be
# calling into git to write the current SHA into the binaries.
shallow_clone: false
environment:
COMPILER_FAMILY: MSVC
HTM_CORE: "C:\\projects\\htm-core"
ARTIFACTS_DIR: "%HTM_CORE%\\build\\artifacts"
configuration: "Release"
GITHUB_TOKEN: "128d14941694608b928f9e382f70abba4fe36ad5"
TWINE_USERNAME: "__token__" # token for PYPI test account for David Keeney. Not for production
TWINE_PASSWORD: "pypi-AgENdGVzdC5weXBpLm9yZwIkOTk0YmZjNGYtZTgxNS00Yjk2LTg5ZTAtODE1MGI4MjZhNGZlAAIleyJwZXJtaXNzaW9ucyI6ICJ1c2VyIiwgInZlcnNpb24iOiAxfQAABiDXJOuxvodsEDoD5dOH-e0td1DdUSwrl2NCl_lP_vy6RA"
matrix:
# # Win64-gcc
# - NC_CMAKE_GENERATOR: "MinGW Makefiles"
# external_static_subdir: "windows64-gcc"
# wheel_name_suffix: "win_amd64"
# # Win32-gcc
# - NC_CMAKE_GENERATOR: "MinGW Makefiles"
# PYTHON_VERSION: "2.7.9"
# PYTHON_ARCH: "32"
# PYTHONHOME: "C:\\Python27"
# external_static_subdir: "windows32-gcc"
# wheel_name_suffix: "win32"
# Win64-Visual Studio
- NC_CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
PYTHON_VERSION: "3.6.6"
PYTHON_ARCH: "64"
PYTHONHOME: "C:\\Python36-x64"
#PYTHONHOME: "C:\\Users\\appveyor\\AppData\\Roaming\\Python\\Python36"
PYTHONPATH: "%PYTHONHOME%"
PATH: "%PYTHONHOME%\\Scripts;%PYTHONHOME%;%PATH%"
wheel_name_suffix: "win_amd64"
matrix:
fast_finish: true
## Dont know where this goes: skip_branch_with_pr: true
#allow_failures:
# # enable this to prevent CI from failing even if there are errors.
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
# Dump appveyor build vars for diagnostics
- "ECHO APPVEYOR_FORCED_BUILD: %APPVEYOR_FORCED_BUILD%"
- "ECHO APPVEYOR_RE_BUILD: %APPVEYOR_RE_BUILD%"
- for /f %%i in ('type VERSION') do set BINDINGS_VERSION=%%i
- echo Binding version = %BINDINGS_VERSION%
- python -m pip install --user --upgrade pip setuptools setuptools-scm wheel || exit
# we need to find the previous git tags so a shallow clone is not enough
- git fetch --depth=200
# Build the library with the python interface (64bit Release build)
- cd %HTM_CORE%
- python setup.py install --user --force
after_build:
# Run C++ & python tests
- cd %HTM_CORE%
- python setup.py test
# Build the wheel
- python setup.py bdist_wheel
# Build the github package in build/scripts/*.zip or build/scripts/*.tar.gz
- cd %HTM_CORE%\build\scripts
- cmake --build . --config Release --target PACKAGE
- cd %HTM_CORE%
# Disable automatic tests
test: off
artifacts:
# Non-recursive search in build folder for github packages
- path: 'build\scripts\*.zip'
name: htm.core
# -----------------------------------------------------------------------
# Deploy to GitHub and PYPI
on_success:
# Only for tagged master builds
# PYPI is not a known 'provider' so it cannot go in the deploy: section
- cmd: echo "executing on_success"
- ps: >-
If ($env:APPVEYOR_REPO -eq "master" -or $env:APPVEYOR_REPO_TAG -eq "True") {
Write-Host "Uploading bindings to GitHub"
python ci/deploy-artifact-to-GitHub.py $env:APPVEYOR_REPO_TAG_NAME "build/scripts/*.zip" $env:GITHUB_TOKEN
Write-Host "Uploading bindings to PYPI"
pip install requests twine --upgrade
set TWINE_REPOSITORY_URL="https://test.pypi.org/legacy/"
cd build/Release/distr
twine upload --skip-existing dist/*.whl
}