28 lines
967 B
Bash
Executable File
28 lines
967 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
tag="${1:-${GITHUB_REF_NAME:-}}"
|
|
version="$(sed -n 's:.*<RendezvousVersion>\(.*\)</RendezvousVersion>.*:\1:p' "$root/eng/Versions.props")"
|
|
|
|
if [[ "$tag" != "v$version" ]]; then
|
|
echo "Release tag $tag does not match central version v$version." >&2
|
|
exit 1
|
|
fi
|
|
if [[ -n "$(git -C "$root" status --porcelain --untracked-files=normal)" ]]; then
|
|
echo "Release tag checkout is not clean." >&2
|
|
exit 1
|
|
fi
|
|
if [[ "$(git -C "$root" tag --points-at HEAD --list "$tag")" != "$tag" ]]; then
|
|
echo "Release tag $tag does not point at the checked-out commit." >&2
|
|
exit 1
|
|
fi
|
|
if ! grep -Eq "^## $version - [0-9]{4}-[0-9]{2}-[0-9]{2}$" "$root/CHANGELOG.md"; then
|
|
echo "CHANGELOG.md must contain a dated heading for $version." >&2
|
|
exit 1
|
|
fi
|
|
if grep -Eq "^## $version - Unreleased$" "$root/CHANGELOG.md"; then
|
|
echo "Release $version is still marked Unreleased." >&2
|
|
exit 1
|
|
fi
|