2017-10-28 06:51:10 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-10-07 00:18:21 +02:00
|
|
|
github_token=${1:-}
|
|
|
|
|
|
|
|
if [[ -z $github_token ]]; then
|
|
|
|
echo "Usage: $0 [github-token]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [[ ! -f NEWS ]]; then
|
|
|
|
echo "Missing NEWS file. Try running from root of repository."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-01-18 05:27:09 +01:00
|
|
|
version=$(head --lines=1 NEWS)
|
|
|
|
git tag $version
|
|
|
|
git push origin $version
|
|
|
|
git push github $version
|
|
|
|
|
2017-10-28 06:51:10 +02:00
|
|
|
rm -fr dist
|
|
|
|
python3 setup.py bdist_wheel
|
|
|
|
python3 setup.py sdist
|
|
|
|
twine upload -r pypi dist/borgmatic-*.tar.gz
|
|
|
|
twine upload -r pypi dist/borgmatic-*-py3-none-any.whl
|
2018-10-07 00:18:21 +02:00
|
|
|
|
|
|
|
github-release create --token="$github_token" --owner=witten --repo=borgmatic --tag="$version" \
|
|
|
|
--name="borgmatic $version" --body="$(sed '/^$/q' NEWS |grep '^\s*\*')"
|