[travis] use twine to upload to PyPI
This commit is contained in:
parent
9424f61453
commit
056bd7d967
21
.travis.yml
21
.travis.yml
@ -3,9 +3,10 @@ sudo: false
|
|||||||
language: python
|
language: python
|
||||||
python: 3.5
|
python: 3.5
|
||||||
|
|
||||||
# empty "env:" is needed for 'allow_failures'
|
|
||||||
# https://docs.travis-ci.com/user/customizing-the-build/#Rows-that-are-Allowed-to-Fail
|
|
||||||
env:
|
env:
|
||||||
|
global:
|
||||||
|
- TWINE_USERNAME="anthrotype"
|
||||||
|
- secure: PJuCmlDuwnojiw3QuDhfNAaU4f/yeJcEcRzJAudA66bwZK7hvxV7Tiy9A17Bm6yO0HbJmmyjsIr8h2e7/PyY6QCaV8RqcMDkQ0UraU16pRsihp0giVXJoWscj2sCP4cNDOBVwSaGAX8yZ2OONc5srESywghzcy8xmgw6O+XFqx4=
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
@ -73,9 +74,6 @@ script:
|
|||||||
after_success:
|
after_success:
|
||||||
- ./.travis/after_success.sh
|
- ./.travis/after_success.sh
|
||||||
|
|
||||||
before_deploy:
|
|
||||||
- ./.travis/before_deploy.sh
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
irc: "irc.freenode.org##fonts"
|
irc: "irc.freenode.org##fonts"
|
||||||
email: fonttools-dev@googlegroups.com
|
email: fonttools-dev@googlegroups.com
|
||||||
@ -93,16 +91,3 @@ deploy:
|
|||||||
repo: fonttools/fonttools
|
repo: fonttools/fonttools
|
||||||
all_branches: true
|
all_branches: true
|
||||||
condition: "$BUILD_DIST == true"
|
condition: "$BUILD_DIST == true"
|
||||||
# deploy to PyPI on tags
|
|
||||||
- provider: pypi
|
|
||||||
server: https://upload.pypi.org/legacy/
|
|
||||||
user: anthrotype
|
|
||||||
password:
|
|
||||||
secure: DxAf1E0u4Xxe3+R9flkz69g84pfEQF2knDmKhZVzCJBbz9DUjuQlAWGZoAbn9kZIW0bq3yNIihVP5fjxgs0zKO7M4OCVRisVAgZDAZzsRo7awX9dBsyaTGt9WXvzVKCFPcehKI3lZ/fuPvovY+Dl4c91F5qfkh0pY6OKy9uDj3k=
|
|
||||||
skip_cleanup: true
|
|
||||||
distributions: pass
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
repo: fonttools/fonttools
|
|
||||||
all_branches: true
|
|
||||||
condition: "$BUILD_DIST == true"
|
|
||||||
|
@ -9,3 +9,8 @@ fi
|
|||||||
|
|
||||||
# upload coverage data to Codecov.io
|
# upload coverage data to Codecov.io
|
||||||
[[ ${TOXENV} == *"-cov"* ]] && tox -e codecov
|
[[ ${TOXENV} == *"-cov"* ]] && tox -e codecov
|
||||||
|
|
||||||
|
# if tagged commit, create distribution packages and deploy to PyPI
|
||||||
|
if [ -n "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "fonttools/fonttools" ] && [ "$BUILD_DIST" == true ]; then
|
||||||
|
tox -e pypi
|
||||||
|
fi
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# build sdist and wheel distribution packages in ./dist folder.
|
|
||||||
# Travis runs the `before_deploy` stage before each deployment, but
|
|
||||||
# we only want to build them once, as we want to use the same
|
|
||||||
# files for both Github and PyPI
|
|
||||||
if $(ls ./dist/fonttools*.zip > /dev/null 2>&1) && \
|
|
||||||
$(ls ./dist/fonttools*.whl > /dev/null 2>&1); then
|
|
||||||
echo "Distribution packages already exists; skipping"
|
|
||||||
else
|
|
||||||
tox -e bdist
|
|
||||||
fi
|
|
12
tox.ini
12
tox.ini
@ -52,9 +52,19 @@ commands =
|
|||||||
# check metadata and rst long_description
|
# check metadata and rst long_description
|
||||||
python setup.py check --restructuredtext --strict
|
python setup.py check --restructuredtext --strict
|
||||||
# clean up build/ and dist/ folders
|
# clean up build/ and dist/ folders
|
||||||
rm -rf {toxinidir}/dist
|
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
|
||||||
python setup.py clean --all
|
python setup.py clean --all
|
||||||
# build sdist
|
# build sdist
|
||||||
python setup.py sdist --dist-dir {toxinidir}/dist
|
python setup.py sdist --dist-dir {toxinidir}/dist
|
||||||
# build wheel from sdist
|
# build wheel from sdist
|
||||||
pip wheel -v --no-deps --no-index --wheel-dir {toxinidir}/dist --find-links {toxinidir}/dist fonttools
|
pip wheel -v --no-deps --no-index --wheel-dir {toxinidir}/dist --find-links {toxinidir}/dist fonttools
|
||||||
|
|
||||||
|
[testenv:pypi]
|
||||||
|
deps =
|
||||||
|
{[testenv:bdist]deps}
|
||||||
|
twine
|
||||||
|
skip_install = true
|
||||||
|
passenv = TWINE_USERNAME TWINE_PASSWORD
|
||||||
|
commands =
|
||||||
|
{[testenv:bdist]commands}
|
||||||
|
twine upload dist/*.whl dist/*.zip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user