Skip to content

Commit

Permalink
setup automatic deployment on tags to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Nov 29, 2019
1 parent 572b008 commit edf8bfb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
23 changes: 18 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\.appveyor\\run_with_env.cmd"
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\.appveyor\\run_with_env.cmd"
TWINE_USERNAME: "anthrotype"
TWINE_PASSWORD:
secure: 9L/DdqoIILlN7qCh0lotvA==

matrix:
- PYTHON: "C:\\Python27"
Expand Down Expand Up @@ -91,3 +93,14 @@ after_test:
artifacts:
# Archive the generated packages in the ci.appveyor.com build report
- path: wheelhouse\*.whl

# Deploy wheels on tags to PyPI
on_success:
- ps: >-
if($env:APPVEYOR_REPO_TAG -eq 'true') {
Write-Output ("Deploying " + $env:APPVEYOR_REPO_TAG_NAME + " to PyPI...")
pip install --upgrade twine
twine upload wheelhouse\*.whl
} else {
Write-Output "Not deploying as this is not a tagged commit"
}
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ env:
- TEST_DEPENDS="sympy unittest2 pytest"
- PLAT=x86_64
- UNICODE_WIDTH=32
- TWINE_USERNAME="anthrotype"
- secure: sX3wbNcie0SOjV9r/7IqkmqDlBY5trhFLIGUzQmo0gdiKxSWM/07HkIbAHhXZB/nINkXGtWuhNdE3OQsh6MilODU5krE8hOOvfhh2lyrWVFk8BQstyeKZVlhGRX8GQfOViaOBncybnqPR5ovmAAo0whg+8qtL+kCE7MtmvG9WAQeeyhu45lg25ac/ZrUkJv1y/rjW9EuRDidGquU/1xcRe3s1H/2OnVvWaUgbU2KwTWQ2DRnXXeMdP3OgY8o818c7utjCt+gGaDmJgoJH0Bz8OiuNAZJrODp/0L/LeLDzyoI0Yc3osDlv5xnJq7Fsyer1ihV6ZuAaXZU1TkJvH4B5CeMWIUcWLxA3sOrAn3DDMO3ZdvsvYPOaCuI/k/4RCPZyV57h76Ibm6Qir71Fe4oNpIRiQm/zfD2H6Ez+E1R0u4SgPRsPFsD/YGF58vvP8KHliTMJCM27p5+ai6+ZDB0r7sLRVk0w/HLElRMNmpIcCEDcIjkZS95xffxRcQSXvj1otDDGcNxao4OxPdzbt2zIUZgsN+5uFjA3A0iAWwXd1/Auy11uqG+abDTxg5mAxQ0ovVsvL3Mle6CfvEp7e1mvpHxZRFARpjTH24Gt8nGGcakLeddhy43z0jpJxmYVxnPloDHTbSzvRnubwY0oIe3cZSbcxSJh1qWdzD66FNul5c=

# Travis only clones the latest 50 commits. We need the full repository to
# compute the version string from the git metadata:
Expand Down Expand Up @@ -40,14 +42,14 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- BUILD_SDIST=true
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- PLAT=i686
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- BUILD_SDIST=true
- os: linux
env:
- MB_PYTHON_VERSION=3.6
Expand Down Expand Up @@ -94,5 +96,14 @@ script:
- install_run $PLAT

after_success:
# if tagged, create the source distribution for the deploy stage
- if [ -n "$TRAVIS_TAG" ] && [ "$BUILD_SDIST" == true ]; then pip install cython; pip install -U setuptools; python setup.py sdist -d ${TRAVIS_BUILD_DIR}/wheelhouse; fi
# if tagged, upload wheels (and sdist) to PyPI
- |
if [ -n "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "fonttools/pyclipper" ]; then
pip install --upgrade twine
twine upload wheelhouse/*.whl
if [ "$BUILD_SDIST" == true ]; then
pip install --upgrade cython setuptools
python setup.py sdist
twine upload dist/*.zip
fi
fi

0 comments on commit edf8bfb

Please sign in to comment.