-
Notifications
You must be signed in to change notification settings - Fork 95
/
appveyor.yml
252 lines (173 loc) · 6.61 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
version: 1.0.{build}
os: Visual Studio 2015
environment:
WHEEL_DIR: C:\kivent_wheels
KIVENT_BUILD_DIR: C:\kivent_build
KIVENT_USE_SETUPTOOLS: 1
CYMUNK_USE_SETUPTOOLS: 1
KEY_WITH_NO_TEETH:
secure: 7cS7xjpCL/VH5jIIGSf13camkiu1enMh5hO0UsBgmRlBXyKk3t/7HB79ofyJKgDb
MSYSTEM: MINGW64
CHERE_INVOKING: 1
matrix:
- PYVER: 35
BITTNESS: 86
- PYVER: 35
BITTNESS: 64
- PYVER: 36
BITTNESS: 86
- PYVER: 36
BITTNESS: 64
- PYVER: 37
BITTNESS: 86
- PYVER: 37
BITTNESS: 64
install:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))
build_script:
- nuget install secure-file -ExcludeVersion
- ps: >-
function Check-Error
{
param([int]$SuccessVal = 0)
if ($SuccessVal -ne $LastExitCode) {
throw "Failed with exit code $LastExitCode"
}
}
echo "Bitness=$env:BITTNESS, scheduled=$env:APPVEYOR_SCHEDULED_BUILD, forced=$env:APPVEYOR_FORCED_BUILD, rebuild=$env:APPVEYOR_RE_BUILD, tagged=$env:APPVEYOR_REPO_TAG"
cd $env:APPVEYOR_BUILD_FOLDER
git clone -q --branch=master https://github.com/kivy/kivy-sdk-packager.git C:\projects\kivy-sdk-packager
Check-Error
$PYTHONPATH = "$env:APPVEYOR_BUILD_FOLDER;$PYTHONPATH"
echo "Build folder: $env:APPVEYOR_BUILD_FOLDER. Wheel folder: $env:WHEEL_DIR."
mkdir "$env:KIVENT_BUILD_DIR"
Check-Error
mkdir "$env:WHEEL_DIR"
Check-Error
# Get ARCH for wheels
if ($env:BITTNESS -eq "64") {
$PYTHON_ROOT = "C:\Python$env:PYVER-x64"
$WHEEL_BITNESS = "win_amd64"
} else {
$PYTHON_ROOT = "C:\Python$env:PYVER"
$WHEEL_BITNESS = "win32"
}
$WHEEL_DATE = python -c "from datetime import datetime;print(datetime.utcnow().strftime('%Y%m%d'))"
$GIT_TAG = git rev-parse --short HEAD
Check-Error
$env:PATH = "$PYTHON_ROOT;$PYTHON_ROOT\Scripts;$env:PATH;C:\Program Files\7-Zip"
$env:PATH = $PYTHON_ROOT+"\share\glew\bin;"+$PYTHON_ROOT+"\share\sdl2\bin;"+$env:PATH
Check-Error
# Set up shortcuts
$WD = ${env:WHEEL_DIR}
$CP = "cp${env:PYVER}-cp${env:PYVER}m-${WHEEL_BITNESS}.whl"
$R = "import re;import os;f=open(os.path.join('"
$X = "','setup.py'));print(re.findall('version=\'(.*?)\',?',f.read())[-1]);f.close()"
Check-Error
$env:DO_TEST = "False" # switch to True when tests are available
if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True"){
$env:DO_TEST = "False"
}
$DO_WHEEL = "True"
# Set new wheel name, keep default if release (tag)
# release: KivEnt-X.Y.Z-cpAB-cpABm-ARCH.whl
# nightly: KivEnt-X.Y.Z.dev0-cpAB-cpABm-ARCH.whl
# archive: KivEnt-X.Y.Z.dev0.YYYYMMDD.githash-cpAB-cpABm-ARCH.whl
if ($env:APPVEYOR_REPO_TAG -eq "true"){
$WHEEL_NAME = "dev0-"
} elseif ($env:APPVEYOR_SCHEDULED_BUILD -eq "True" -or $env:APPVEYOR_FORCED_BUILD -eq "True" -or $env:APPVEYOR_RE_BUILD -eq "True"){
$WHEEL_NAME = "dev0.$WHEEL_DATE`.$GIT_TAG-"
} else {
$DO_WHEEL = "False"
}
if ($env:APPVEYOR_REPO_BRANCH -ne "master") {
$DO_WHEEL = "False"
}
echo "test=$env:DO_TEST, make_wheel=$DO_WHEEL"
python -m pip install pip wheel setuptools --upgrade
Check-Error
pip install mock cython pygments docutils nose kivy.deps.glew_dev kivy.deps.glew kivy.deps.sdl2_dev kivy.deps.sdl2
Check-Error
pip install kivy.deps.angle
$kivy_url = "https://kivy.org/downloads/appveyor/kivy"
# get kivy version at runtime later, magically
pip install "$kivy_url/Kivy-2.0.0.dev0-${CP}"
Check-Error
# Create cymunk wheel (kivent_cymunk dependency)
echo "requisite lib cymunk not installing on windows in python 3.5+, see https://github.com/kivy/cymunk/issues/52"
$cymunk_fixed = False
if ($cymunk_fixed -eq "True") {
git clone -q --branch=master https://github.com/kivy/cymunk.git C:\projects\cymunk
Check-Error
cd C:\projects\cymunk
python setup.py bdist_wheel -d "${WD}"
Check-Error
# find a way how to check version dynamically (same as kivy)
pip install "${WD}\cymunk-0.0.0.dev0-${CP}"
Check-Error
}
cd $env:APPVEYOR_BUILD_FOLDER
# cd to kivent/modules, list modules
if ($DO_WHEEL -eq "True") {
cd modules
$modules = Get-ChildItem "$pwd" -Name
echo "Found KivEnt modules: [$modules]"
Check-Error
# Get versions from modules' setup.py
foreach ($mod in $modules) {
if ($mod -eq "core") {
$CORE_V = python -c "${R}${mod}${X}"
} elseif ($mod -eq "cymunk") {
if ($cymunk_fixed -eq "True") {
$CYM_V = python -c "${R}${mod}${X}"
}
} elseif ($mod -eq "maps") {
$MAPS_V = python -c "${R}${mod}${X}"
} elseif ($mod -eq "particles") {
$PART_V = python -c "${R}${mod}${X}"
} elseif ($mod -eq "projectiles") {
$PROJ_V = python -c "${R}${mod}${X}"
}
}
Check-Error
# Make wheels & pip install after
foreach ($mod in $modules) {
cd "$mod"
if (test-path "setup.py") {python setup.py bdist_wheel -d "${WD}"}
Check-Error
cd ..
if ($mod -eq "core") {
pip install "${WD}\KivEnt_Core-${CORE_V}-${CP}"
} elseif ($mod -eq "cymunk") {
if ($cymunk_fixed -eq "True") {
pip install "${WD}\KivEnt_Cymunk-${CYM_V}-${CP}"
}
} elseif ($mod -eq "maps") {
pip install "${WD}\KivEnt_maps-${MAPS_V}-${CP}"
} elseif ($mod -eq "particles") {
pip install "${WD}\KivEnt_particles-${PART_V}-${CP}"
} elseif ($mod -eq "projectiles") {
pip install "${WD}\KivEnt_projectiles-${PROJ_V}-${CP}"
}
dir "${WD}"
}
# Default file bdist_wheel creates:
# KivEnt-X.Y.Z[.dev0]-cpAB-cpABm-ARCH.whl
$files = Get-ChildItem "$env:WHEEL_DIR" *.whl -Name
foreach ($WHEEL_DEFAULT in $files){
echo "Wheel file: $env:WHEEL_DIR\$WHEEL_DEFAULT"
$WHEEL_NIGHTLY = $WHEEL_DEFAULT.Replace("dev0-", $WHEEL_NAME)
echo "Nightly file: $env:WHEEL_DIR\$WHEEL_NIGHTLY"
Check-Error
echo "Copying from default $WHEEL_DEFAULT to nightly $WHEEL_NIGHTLY"
Copy-Item "$env:WHEEL_DIR\$WHEEL_DEFAULT" "$env:WHEEL_DIR\$WHEEL_NIGHTLY"
Check-Error
}
dir "${WD}"
# nuget secure-file is here
cd C:\projects\kivent
secure-file\tools\secure-file -decrypt C:\projects\kivent\tools\appveyor\id_rsa.enc -secret "$env:KEY_WITH_NO_TEETH"
Check-Error
C:\msys64\usr\bin\bash --login C:\projects\kivent\tools\appveyor\kivent-upload.sh
Check-Error
}