hub/script/tag-release

25 строки
543 B
Plaintext
Исходник Обычный вид История

2019-10-08 12:14:24 +03:00
#!/bin/bash
set -e
version_file="version/version.go"
if git diff --exit-code >/dev/null -- "$version_file"; then
echo "Update the version in $version_file and try again." >&2
exit 1
fi
version="$(grep -w 'Version =' "$version_file" | cut -d'"' -f2)"
git commit -m "hub $version" -- "$version_file"
notes_file="$(mktemp)"
{ echo "hub $version"
echo
2020-01-21 15:38:23 +03:00
GITHUB_REF="refs/tags/v$version" script/changelog
2019-10-08 12:14:24 +03:00
} >"$notes_file"
trap "rm -f '$notes_file'" EXIT
2019-10-08 12:14:24 +03:00
git tag "v${version}" -F "$notes_file" --edit
git push origin HEAD "v${version}"