You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

57 lines
1.4 KiB

  1. #!/bin/bash
  2. set -ex
  3. VERSION=$(python -c "from src.wstools.version import __version__ ; print __version__")
  4. echo Preparing to release version $VERSION
  5. #source tox
  6. #pip install --upgrade pep8 autopep8 docutils
  7. echo === Testings ===
  8. if ! python setup.py test; then
  9. echo "The test suite failed. Fix it!"
  10. exit 1
  11. fi
  12. echo === Chechink that all changes are commited and pushed ===
  13. git pull -u
  14. git diff
  15. # Disallow unstaged changes in the working tree
  16. if ! git diff-files --check --exit-code --ignore-submodules -- >&2
  17. then
  18. echo >&2 "error: you have unstaged changes."
  19. #git diff-files --check --exit-code --ignore-submodules -- >&2
  20. exit 1
  21. fi
  22. # Disallow uncommitted changes in the index
  23. if ! git diff-index --cached --exit-code -r --ignore-submodules HEAD -- >&2
  24. then
  25. echo >&2 "error: your index contains uncommitted changes."
  26. exit 1
  27. fi
  28. echo "Please don't run this as a user. This generates a new release for PyPI. Press ^C to exit or Enter to continue."
  29. read
  30. # Clear old distutils stuff
  31. rm -rf build dist MANIFEST &> /dev/null
  32. # Build installers, etc. and upload to PyPI
  33. # python setup.py register sdist bdist_wininst upload
  34. #python setup.py register sdist build_sphinx upload upload_sphinx
  35. python setup.py register sdist upload
  36. git tag -f -a $VERSION -m "Version $VERSION"
  37. git tag -f -a RELEASE -m "Current RELEASE"
  38. git push origin --tags
  39. echo "done."