release.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. echo "checking that the version is valid"
  22. python release/check_release_version.py --release_version ${version}
  23. if [ $? != 0 ]; then
  24. echo 'please check the version number selected'
  25. exit 1
  26. fi
  27. python -c "import twine"
  28. if [ $? != 0 ]; then
  29. echo 'please install twine via pip'
  30. exit 1
  31. fi
  32. DS_BUILD_STRING="" python setup.py sdist
  33. if [ ! -f dist/deepspeed-${version}.tar.gz ]; then
  34. echo "prepared version does not match version given ($version), bump version first?"
  35. ls dist
  36. exit 1
  37. fi
  38. python -m twine upload dist/deepspeed-${version}.tar.gz --repository deepspeed
  39. git tag v${version}
  40. git push origin v${version}
  41. echo "bumping up patch version"
  42. python release/bump_patch_version.py --current_version ${version}