2016-11-26 14:13:55 +00:00
version : 1.0 .{build}
2016-12-19 04:20:24 +00:00
os : Visual Studio 2015
2016-11-26 14:13:55 +00:00
environment :
WHEEL_DIR : C:\kivy_wheels
2018-06-17 20:45:31 +00:00
UPLOAD_DIR : C:\kivy_upload
2016-11-26 14:13:55 +00:00
KIVY_BUILD_DIR : C:\kivy_build
2017-06-20 08:44:32 +00:00
DO_WHEEL : True
2017-05-13 20:52:55 +00:00
KEY_WITH_NO_TEETH :
secure : 7cS7xjpCL/VH5jIIGSf13camkiu1enMh5hO0UsBgmRlBXyKk3t/7HB79ofyJKgDb
2018-06-01 05:25:19 +00:00
SERVER_IP : 159.203 .106 .198
2016-11-26 14:13:55 +00:00
USE_SDL2 : 1
USE_GSTREAMER : 1
KIVY_USE_SETUPTOOLS : 1
2017-02-10 23:11:24 +00:00
KIVY_SPLIT_EXAMPLES : 1
2017-05-13 20:52:55 +00:00
MSYSTEM : MINGW64
2019-06-01 23:29:09 +00:00
BUILD_EXAMPLES_SDIST : 0
2017-05-13 20:52:55 +00:00
CHERE_INVOKING : 1
2019-05-29 14:46:51 +00:00
GST_REGISTRY : ~/registry.bin
2016-11-26 14:13:55 +00:00
matrix :
2016-12-19 04:20:24 +00:00
- PYVER : 35
BITTNESS : 86
- PYVER : 35
BITTNESS : 64
2017-01-31 19:25:43 +00:00
- PYVER : 36
BITTNESS : 86
- PYVER : 36
BITTNESS : 64
2018-07-10 19:57:15 +00:00
- PYVER : 37
BITTNESS : 86
- PYVER : 37
BITTNESS : 64
2019-06-01 23:29:09 +00:00
BUILD_EXAMPLES_SDIST : 1
2016-11-26 14:13:55 +00:00
install :
- ps : iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))
build_script :
2017-05-13 20:52:55 +00:00
- nuget install secure-file -ExcludeVersion
2016-11-26 14:13:55 +00:00
- ps : >-
function Check-Error
{
param([int]$SuccessVal = 0)
if ($SuccessVal -ne $LastExitCode) {
throw "Failed with exit code $LastExitCode"
}
}
2018-06-17 19:37:11 +00:00
echo "Bitness=$env:BITTNESS, scheduled=$env:APPVEYOR_SCHEDULED_BUILD, forced=$env:APPVEYOR_FORCED_BUILD"
2016-11-26 14:13:55 +00:00
2019-06-01 23:29:09 +00:00
echo "rebuild=$env:APPVEYOR_RE_BUILD, tagged=$env:APPVEYOR_REPO_TAG, pr=$env:APPVEYOR_PULL_REQUEST_NUMBER"
2016-11-26 14:13:55 +00:00
2019-06-01 23:29:09 +00:00
echo "commit=$env:APPVEYOR_REPO_COMMIT_MESSAGE, branch"
2016-11-26 14:13:55 +00:00
2019-06-01 23:29:09 +00:00
echo "branch=$env:APPVEYOR_REPO_BRANCH"
2016-11-26 14:13:55 +00:00
2019-06-01 23:29:09 +00:00
cd $env:APPVEYOR_BUILD_FOLDER
2016-11-26 14:13:55 +00:00
2019-05-24 02:19:21 +00:00
$env:PYTHONPATH = "$env:APPVEYOR_BUILD_FOLDER;$PYTHONPATH"
2016-11-26 14:13:55 +00:00
2019-06-01 23:29:09 +00:00
echo "Build folder: $env:KIVY_BUILD_DIR. Project folder: $env:APPVEYOR_BUILD_FOLDER. Wheel folder: $env:WHEEL_DIR."
2016-11-26 14:13:55 +00:00
mkdir "$env:KIVY_BUILD_DIR"
mkdir "$env:WHEEL_DIR"
if ($env:BITTNESS -eq "64") {
$PYTHON_ROOT = "C:\Python$env:PYVER-x64"
$WHELL_BITNESS = "win_amd64"
} else {
$PYTHON_ROOT = "C:\Python$env:PYVER"
$WHELL_BITNESS = "win32"
}
$env:PATH = "$PYTHON_ROOT;$PYTHON_ROOT\Scripts;$env:PATH;C:\Program Files\7-Zip"
2016-11-28 00:54:30 +00:00
$env:PATH = $PYTHON_ROOT+"\share\glew\bin;"+$PYTHON_ROOT+"\share\sdl2\bin;"+$PYTHON_ROOT+"\share\gstreamer\bin;"+$env:PATH
2016-11-26 14:13:55 +00:00
2019-06-01 23:29:09 +00:00
echo "PATH is: $env:PATH"
2017-01-27 23:11:12 +00:00
$WHEEL_DATE = python -c "from datetime import datetime;print(datetime.utcnow().strftime('%Y%m%d'))"
2016-11-26 14:13:55 +00:00
Check-Error
$GIT_TAG = git rev-parse --short HEAD
Check-Error
python -c "import kivy"
Check-Error
$WHEEL_VERSION = python -c "import kivy;print(kivy.__version__)" --config "kivy:log_level:error"
Check-Error
2016-12-07 09:42:03 +00:00
echo "Kivy version is: $WHEEL_VERSION"
2016-11-26 14:13:55 +00:00
python -c "import sys;print('Python version is {}'.format(sys.version))"
Check-Error
$env:DO_TEST = "True"
if ($env:APPVEYOR_SCHEDULED_BUILD -eq "True"){
$env:DO_TEST = "False"
}
2017-05-13 20:52:55 +00:00
$DO_WHEEL = $env:DO_WHEEL
2016-11-29 23:21:32 +00:00
2017-01-28 18:54:46 +00:00
# Set new wheel name, keep default if release (tag)
2017-02-10 23:11:24 +00:00
# release: Kivy-X.Y.Z-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z-py2.py3-none-any.whl)
# nightly: Kivy-X.Y.Z.dev0-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z.dev0-py2.py3-none-any.whl)
# archive: Kivy-X.Y.Z.dev0.YYYYMMDD.githash-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z.dev0.YYYYMMDD.githash-py2.py3-none-any.whl)
2017-01-28 18:54:46 +00:00
2019-06-01 23:29:09 +00:00
$TAG_NAME = python -c "import kivy; _, tag, n = kivy.parse_kivy_version(kivy.__version__); print(tag + n) if n is not None else print(tag or 'something')" --config "kivy:log_level:error"
2019-05-16 04:25:21 +00:00
2016-11-26 14:13:55 +00:00
if ($env:APPVEYOR_REPO_TAG -eq "true"){
2019-05-16 04:25:21 +00:00
$WHEEL_NAME = "$TAG_NAME-"
2018-06-17 18:39:26 +00:00
} elseif (-not $env:APPVEYOR_PULL_REQUEST_NUMBER -and($env:APPVEYOR_SCHEDULED_BUILD -eq "True" -or $env:APPVEYOR_REPO_COMMIT_MESSAGE.Contains("[build wheel]") -or $env:APPVEYOR_REPO_COMMIT_MESSAGE.Contains("[build wheel win]"))){
2019-05-16 04:25:21 +00:00
$WHEEL_NAME = "$TAG_NAME.$WHEEL_DATE`.$GIT_TAG-"
2016-11-26 14:13:55 +00:00
} else {
$DO_WHEEL = "False"
}
echo "test=$env:DO_TEST, make_wheel=$DO_WHEEL"
2016-12-19 04:20:24 +00:00
python -m pip install pip wheel setuptools --upgrade
2016-11-26 14:13:55 +00:00
2016-12-19 04:20:24 +00:00
Check-Error
2018-06-30 16:17:24 +00:00
pip install cython
2018-06-30 07:22:51 +00:00
Check-Error
2018-06-26 15:32:19 +00:00
# sdist must happen before anything else
2019-06-01 23:29:09 +00:00
if ($DO_WHEEL -eq "True" -and $env:BUILD_EXAMPLES_SDIST -eq "1") {
2018-06-26 15:32:19 +00:00
python setup.py sdist --formats=gztar -d "$env:WHEEL_DIR"
Check-Error
}
2019-02-25 10:55:51 +00:00
2019-05-24 02:19:21 +00:00
pip install mock cython pygments docutils pytest pyinstaller kivy_deps.glew_dev kivy_deps.glew kivy_deps.gstreamer_dev kivy_deps.sdl2_dev kivy_deps.sdl2
2018-06-30 16:17:24 +00:00
2019-05-29 14:46:51 +00:00
pip --no-cache-dir install kivy_deps.gstreamer
2018-06-30 16:17:24 +00:00
Check-Error
2018-06-26 15:32:19 +00:00
2019-06-01 23:29:09 +00:00
pip install kivy_deps.angle
2016-12-19 04:23:53 +00:00
2016-12-19 04:20:24 +00:00
if ($env:DO_TEST -eq "True" -or $DO_WHEEL -eq "True") {
2016-11-26 15:20:43 +00:00
python setup.py build_ext --inplace
2016-11-26 15:10:44 +00:00
Check-Error
}
2016-11-26 14:13:55 +00:00
if ($DO_WHEEL -eq "True") {
python setup.py bdist_wheel -d "$env:WHEEL_DIR"
Check-Error
2019-06-01 23:29:09 +00:00
if ($env:BUILD_EXAMPLES_SDIST -eq "1") {
2017-02-10 23:11:24 +00:00
python setup.py bdist_wheel -d "$env:WHEEL_DIR" --build_examples --universal
Check-Error
}
2016-12-07 09:42:03 +00:00
2017-02-10 23:11:24 +00:00
# Default file bdist_wheel creates:
# Kivy-X.Y.Z[.dev0]-cpAB-cpABm-ARCH.whl (Kivy_examples-X.Y.Z[.dev0]-py2.py3-none-any.whl)
$files = Get-ChildItem "$env:WHEEL_DIR" *.whl -Name
foreach ($WHEEL_DEFAULT in $files){
echo "Wheel file: $env:WHEEL_DIR\$WHEEL_DEFAULT"
2019-05-16 04:25:21 +00:00
$WHEEL_NIGHTLY = $WHEEL_DEFAULT.Replace("$TAG_NAME-", $WHEEL_NAME)
2017-02-10 23:11:24 +00:00
echo "Nightly file: $env:WHEEL_DIR\$WHEEL_NIGHTLY"
Check-Error
2018-06-17 19:37:11 +00:00
if (-not (Test-Path "$env:WHEEL_DIR\$WHEEL_NIGHTLY")){
echo "Copying from default $WHEEL_DEFAULT to nightly $WHEEL_NIGHTLY"
Copy-Item "$env:WHEEL_DIR\$WHEEL_DEFAULT" "$env:WHEEL_DIR\$WHEEL_NIGHTLY"
Check-Error
}
2017-02-10 23:11:24 +00:00
}
2016-11-26 14:13:55 +00:00
2018-06-17 20:45:31 +00:00
mkdir "$env:UPLOAD_DIR"
Check-Error
cp "$env:WHEEL_DIR\*.whl" "$env:UPLOAD_DIR"
Check-Error
cp "$env:WHEEL_DIR\*.gz" "$env:UPLOAD_DIR"
Check-Error
2018-06-01 05:25:19 +00:00
secure-file\tools\secure-file -decrypt C:\projects\kivy\.ci\id_rsa.enc -secret "$env:KEY_WITH_NO_TEETH"
2016-11-26 14:13:55 +00:00
Check-Error
2018-06-17 20:45:31 +00:00
echo "Uploading Kivy*:"
2018-06-17 19:37:11 +00:00
dir $env:WHEEL_DIR
2018-06-17 20:45:31 +00:00
dir $env:UPLOAD_DIR
C:\msys64\usr\bin\bash --login -c "/c/projects/kivy/.ci/appveyor-server-upload.sh $env:SERVER_IP '$env:UPLOAD_DIR' 'Kivy*' ci/win/kivy/"
2016-11-26 14:13:55 +00:00
Check-Error
2017-05-13 20:52:55 +00:00
2016-11-26 14:13:55 +00:00
}
test_script :
- ps : >-
function Check-Error
{
param([int]$SuccessVal = 0)
if ($SuccessVal -ne $LastExitCode) {
throw "Failed with exit code $LastExitCode"
}
}
if ($env:DO_TEST -eq "True"){
2019-06-01 23:29:09 +00:00
$env:KIVY_GL_BACKEND = "angle_sdl2"
2019-02-25 10:55:51 +00:00
python -m pytest kivy/tests
2016-11-26 14:13:55 +00:00
Check-Error
2016-12-19 04:20:24 +00:00
}