version: 1.0.{build} os: Visual Studio 2015 environment: WHEEL_DIR: C:\kivy_wheels UPLOAD_DIR: C:\kivy_upload KIVY_BUILD_DIR: C:\kivy_build DO_WHEEL: True KEY_WITH_NO_TEETH: secure: 7cS7xjpCL/VH5jIIGSf13camkiu1enMh5hO0UsBgmRlBXyKk3t/7HB79ofyJKgDb SERVER_IP: 159.203.106.198 USE_SDL2: 1 USE_GSTREAMER: 1 KIVY_USE_SETUPTOOLS: 1 KIVY_SPLIT_EXAMPLES: 1 MSYSTEM: MINGW64 BUILD_EXAMPLES_SDIST: 0 CHERE_INVOKING: 1 GST_REGISTRY: ~/registry.bin 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 BUILD_EXAMPLES_SDIST: 1 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" echo "rebuild=$env:APPVEYOR_RE_BUILD, tagged=$env:APPVEYOR_REPO_TAG, pr=$env:APPVEYOR_PULL_REQUEST_NUMBER" echo "commit=$env:APPVEYOR_REPO_COMMIT_MESSAGE, branch" echo "branch=$env:APPVEYOR_REPO_BRANCH" cd $env:APPVEYOR_BUILD_FOLDER $env:PYTHONPATH = "$env:APPVEYOR_BUILD_FOLDER;$PYTHONPATH" echo "Build folder: $env:KIVY_BUILD_DIR. Project folder: $env:APPVEYOR_BUILD_FOLDER. Wheel folder: $env:WHEEL_DIR." 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" $env:PATH = $PYTHON_ROOT+"\share\glew\bin;"+$PYTHON_ROOT+"\share\sdl2\bin;"+$PYTHON_ROOT+"\share\gstreamer\bin;"+$env:PATH echo "PATH is: $env:PATH" $WHEEL_DATE = python -c "from datetime import datetime;print(datetime.utcnow().strftime('%Y%m%d'))" 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 echo "Kivy version is: $WHEEL_VERSION" 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" } $DO_WHEEL = $env:DO_WHEEL # Set new wheel name, keep default if release (tag) # 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) $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" if ($env:APPVEYOR_REPO_TAG -eq "true"){ $WHEEL_NAME = "$TAG_NAME-" } 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]"))){ $WHEEL_NAME = "$TAG_NAME.$WHEEL_DATE`.$GIT_TAG-" } else { $DO_WHEEL = "False" } echo "test=$env:DO_TEST, make_wheel=$DO_WHEEL" python -m pip install pip wheel setuptools --upgrade Check-Error pip install cython Check-Error # sdist must happen before anything else if ($DO_WHEEL -eq "True" -and $env:BUILD_EXAMPLES_SDIST -eq "1") { python setup.py sdist --formats=gztar -d "$env:WHEEL_DIR" Check-Error } 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 pip --no-cache-dir install kivy_deps.gstreamer Check-Error pip install kivy_deps.angle if ($env:DO_TEST -eq "True" -or $DO_WHEEL -eq "True") { python setup.py build_ext --inplace Check-Error } if ($DO_WHEEL -eq "True") { python setup.py bdist_wheel -d "$env:WHEEL_DIR" Check-Error if ($env:BUILD_EXAMPLES_SDIST -eq "1") { python setup.py bdist_wheel -d "$env:WHEEL_DIR" --build_examples --universal Check-Error } # 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" $WHEEL_NIGHTLY = $WHEEL_DEFAULT.Replace("$TAG_NAME-", $WHEEL_NAME) echo "Nightly file: $env:WHEEL_DIR\$WHEEL_NIGHTLY" Check-Error 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 } } 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 secure-file\tools\secure-file -decrypt C:\projects\kivy\.ci\id_rsa.enc -secret "$env:KEY_WITH_NO_TEETH" Check-Error echo "Uploading Kivy*:" dir $env:WHEEL_DIR 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/" Check-Error } 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"){ $env:KIVY_GL_BACKEND = "angle_sdl2" python -m pytest kivy/tests Check-Error }