build-release-tarball: Verify full releases are tagged and pushed.

This ensures that anything that looks like a full release will
identify itself as such.  It requires that the version have a tag at
the current commit (though it doesn't need to be pushed yet), as well
as the commits exist in `main` or a release branch in the remote.
This commit is contained in:
Alex Vandiver 2022-06-24 00:38:39 +00:00 committed by Alex Vandiver
parent 10c6b249bd
commit 2d132bf342
1 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,19 @@ git checkout-index -f -a --prefix "$TMPDIR/$prefix/"
# Add the Git version information file # Add the Git version information file
./tools/cache-zulip-git-version ./tools/cache-zulip-git-version
if [[ "$version" =~ ^[0-9]+\.[0-9]+$ ]]; then
generated_version=$(head -n1 zulip-git-version)
base_version=$(head -n2 zulip-git-version | tail -n1)
if [ "$generated_version" != "$version" ]; then
echo "Version $version looks like a release version, but is not tagged yet! Got $generated_version"
exit 1
fi
if [ "$base_version" != "$version" ]; then
remote="$(git config zulip.zulipRemote)" || remote=upstream
echo "Commit for $version have not been pushed to remote $remote -- 'branched from' reports $base_version, not $version"
exit 1
fi
fi
mv zulip-git-version "$TMPDIR/$prefix/" mv zulip-git-version "$TMPDIR/$prefix/"
cd "$TMPDIR/$prefix" cd "$TMPDIR/$prefix"