Skip to content

Instantly share code, notes, and snippets.

@niccokunzmann
Created July 18, 2016 08:41
Show Gist options
  • Save niccokunzmann/eda908b62f316dcb085e70613864ddde to your computer and use it in GitHub Desktop.
Save niccokunzmann/eda908b62f316dcb085e70613864ddde to your computer and use it in GitHub Desktop.
upload installer.exe to github. http://blog.fossasia.org/?p=1993&preview=true
# see https://packaging.python.org/appveyor/#adding-appveyor-support-to-your-project
environment:
PYPI_USERNAME: niccokunzmann3
PYPI_PASSWORD:
secure: Gxrd9WI60wyczr9mHtiQHvJ45Oq0UyQZNrvUtKs2D5w=
# For Python versions available on Appveyor, see
# http://www.appveyor.com/docs/installed-software#python
# The list here is complete (excluding Python 2.6, which
# isn't covered by this document) at the time of writing.
# we only need Python 3.4 for kivy
PYTHON: "C:\\Python34"
install:
- "%PYTHON%\\python.exe -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew"
- "%PYTHON%\\python.exe -m pip install -r requirements.txt"
- "%PYTHON%\\python.exe -m pip install -r test-requirements.txt"
- "%PYTHON%\\python.exe setup.py install"
# install requirements for tests of knittingpattern
- "%PYTHON%\\python.exe -m pip install untangle==1.1.0"
build_script:
- cmd: cmd /c windows-build\build.bat
test_script:
# Put your test command here.
# If you don't need to build C extensions on 64-bit Python 3.3 or 3.4,
# you can remove "build.cmd" from the front of the command, as it's
# only needed to support those cases.
# Note that you must use the environment variable %PYTHON% to refer to
# the interpreter you're using - Appveyor does not do anything special
# to put the Python evrsion you want to use on PATH.
- windows-build\dist\KnitEditor\KnitEditor.exe /test
- "%PYTHON%\\python.exe -m pytest --pep8 kniteditor"
after_test:
# This step builds your wheels.
# Again, you only need build.cmd if you're building C extensions for
# 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct
# interpreter
- "%PYTHON%\\python.exe -m pip install wheel"
- "%PYTHON%\\python.exe setup.py bdist_wheel sdist bdist_wininst"
artifacts:
# bdist_wheel puts your built wheel in the dist directory
- path: dist/*
name: distribution
- path: windows-build/dist/Installer/KnitEditorInstaller.exe
name: installer
- path: windows-build/dist/KnitEditor
name: standalone
on_success:
# You can use this step to upload your artifacts to a public website.
# See Appveyor's documentation for more details. Or you can simply
# access your wheels from the Appveyor "artifacts" tab for your build.
- set HOME=.
# in https://ci.appveyor.com/project/niccokunzmann/knittingpattern/settings/environment
# set the variables for the python package index http://pypi.python.org/
# PYPI_USERNAME
# PYPI_PASSWORD
- "%PYTHON%\\python.exe -c \"import os;print('[distutils]\\r\\nindex-servers =\\r\\n pypi\\r\\n\\r\\n[pypi]\\r\\nusername:{PYPI_USERNAME}\\r\\npassword:{PYPI_PASSWORD}\\r\\n'.format(**os.environ))\" > %HOME%\\.pypirc"
# upload to pypi
# check for the tags
# see http://www.appveyor.com/docs/branches#build-on-tags-github-and-gitlab-only
- echo %APPVEYOR_REPO_TAG%
- echo %APPVEYOR_REPO_TAG_NAME%
- "IF %APPVEYOR_REPO_TAG% == true ( FOR /F %%V IN ('%PYTHON%\\python.exe setup.py --version') DO ( IF \"v%%V\" == \"%APPVEYOR_REPO_TAG_NAME%\" ( %PYTHON%\\python.exe setup.py bdist_wininst upload || echo \"Error because the build is already uploaded.\" ) ELSE ( echo \"Invalid tag %APPVEYOR_REPO_TAG_NAME% should be v%%V.\" ) ) ) ELSE ( echo \"Normal build without PyPi deployment.\" )"
deploy:
- provider: GitHub
# http://www.appveyor.com/docs/deployment/github
tag: $(APPVEYOR_REPO_TAG_NAME)
description: "Release $(APPVEYOR_REPO_TAG_NAME)"
auth_token:
secure: j1EbCI55pgsetM/QyptIM/QDZC3SR1i4Xno6jjJt9MNQRHsBrFiod0dsuS9lpcC7
artifact: installer
force_update: true
draft: false
prerelease: false
on:
branch: master # release from master branch only
appveyor_repo_tag: true # deploy on tag push only
- provider: GitHub
# http://www.appveyor.com/docs/deployment/github
tag: $(APPVEYOR_REPO_TAG_NAME)
description: "Release $(APPVEYOR_REPO_TAG_NAME)"
auth_token:
secure: j1EbCI55pgsetM/QyptIM/QDZC3SR1i4Xno6jjJt9MNQRHsBrFiod0dsuS9lpcC7
artifact: standalone
force_update: true
draft: false
prerelease: false
on:
branch: master # release from master branch only
appveyor_repo_tag: true # deploy on tag push only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment