release 668 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. set -e
  3. github_token=${1:-}
  4. if [[ -z $github_token ]]; then
  5. echo "Usage: $0 [github-token]"
  6. exit 1
  7. fi
  8. if [[ ! -f NEWS ]]; then
  9. echo "Missing NEWS file. Try running from root of repository."
  10. exit 1
  11. fi
  12. version=$(head --lines=1 NEWS)
  13. git tag $version
  14. git push origin $version
  15. git push github $version
  16. rm -fr dist
  17. python3 setup.py bdist_wheel
  18. python3 setup.py sdist
  19. twine upload -r pypi dist/borgmatic-*.tar.gz
  20. twine upload -r pypi dist/borgmatic-*-py3-none-any.whl
  21. github-release create --token="$github_token" --owner=witten --repo=borgmatic --tag="$version" \
  22. --name="borgmatic $version" --body="$(sed '/^$/q' NEWS |grep '^\s*\*')"