release.sh 978 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. cd ..
  3. if [ ! -f ~/.pypirc ]; then
  4. echo 'create .pypirc in order to upload to PyPI'
  5. exit 1
  6. fi
  7. version=$1
  8. if [ -z $version ]; then
  9. echo "please provide version number for release"
  10. exit 1
  11. fi
  12. if [[ $version == *"v"* ]]; then
  13. echo "please only include version number without 'v' prefix"
  14. exit 1
  15. fi
  16. if [ "${version}" != `cat version.txt` ]; then
  17. echo "version=${version} does not match version.txt"
  18. cat version.txt
  19. exit 1
  20. fi
  21. python -c "import twine"
  22. if [ $? != 0 ]; then
  23. echo 'please install twine via pip'
  24. exit 1
  25. fi
  26. DS_BUILD_STRING="" python setup.py sdist
  27. if [ ! -f dist/deepspeed-${version}.tar.gz ]; then
  28. echo "prepared version does not match version given ($version), bump version first?"
  29. ls dist
  30. exit 1
  31. fi
  32. python -m twine upload dist/deepspeed-${version}.tar.gz --repository deepspeed
  33. git tag v${version}
  34. git push origin v${version}
  35. echo "bumping up patch version"
  36. cd -
  37. python bump_patch_version.py