mirror of https://github.com/zulip/zulip.git
build-release-tarball: Override merge-base for full official releases.
This commit is contained in:
parent
e95e8b985f
commit
1f1e1e4ec2
|
@ -61,19 +61,16 @@ cd "$BASEDIR"
|
||||||
git checkout-index -f -a --prefix "$OUTPUT_DIR/$prefix/"
|
git checkout-index -f -a --prefix "$OUTPUT_DIR/$prefix/"
|
||||||
|
|
||||||
# Add the Git version information file
|
# Add the Git version information file
|
||||||
./tools/cache-zulip-git-version
|
|
||||||
if [[ "$version" =~ ^[0-9]+\.[0-9]+$ ]]; then
|
if [[ "$version" =~ ^[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
# We override the merge-base, to avoid having to push the commits before building the tarball.
|
||||||
|
OVERRIDE_MERGE_BASE="$version" ./tools/cache-zulip-git-version
|
||||||
generated_version=$(head -n1 zulip-git-version)
|
generated_version=$(head -n1 zulip-git-version)
|
||||||
base_version=$(head -n2 zulip-git-version | tail -n1)
|
|
||||||
if [ "$generated_version" != "$version" ]; then
|
if [ "$generated_version" != "$version" ]; then
|
||||||
echo "Version $version looks like a release version, but is not tagged yet! Got $generated_version"
|
echo "Version $version looks like a release version, but is not tagged yet! Got $generated_version"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ "$base_version" != "$version" ]; then
|
else
|
||||||
remote="$(git config zulip.zulipRemote)" || remote=upstream
|
./tools/cache-zulip-git-version
|
||||||
echo "Commit for $version have not been pushed to remote $remote -- 'branched from' reports $base_version, not $version"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
mv zulip-git-version "$OUTPUT_DIR/$prefix/"
|
mv zulip-git-version "$OUTPUT_DIR/$prefix/"
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,13 @@ cd "$(dirname "$0")/.."
|
||||||
remote="$(git config zulip.zulipRemote)" || remote=upstream
|
remote="$(git config zulip.zulipRemote)" || remote=upstream
|
||||||
{
|
{
|
||||||
git describe --always --tags --match='[0-9]*'
|
git describe --always --tags --match='[0-9]*'
|
||||||
branches="$(git for-each-ref --format='%(objectname)' "refs/remotes/$remote/main" "refs/remotes/$remote/*.x" "refs/remotes/$remote/*-branch")"
|
if [ -z "${OVERRIDE_MERGE_BASE+x}" ]; then
|
||||||
mapfile -t branches <<<"$branches"
|
branches="$(git for-each-ref --format='%(objectname)' "refs/remotes/$remote/main" "refs/remotes/$remote/*.x" "refs/remotes/$remote/*-branch")"
|
||||||
if merge_base="$(git merge-base -- HEAD "${branches[@]}")"; then
|
mapfile -t branches <<<"$branches"
|
||||||
git describe --always --tags --match='[0-9]*' -- "$merge_base"
|
if merge_base="$(git merge-base -- HEAD "${branches[@]}")"; then
|
||||||
|
git describe --always --tags --match='[0-9]*' -- "$merge_base"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$OVERRIDE_MERGE_BASE"
|
||||||
fi
|
fi
|
||||||
} >zulip-git-version
|
} >zulip-git-version
|
||||||
|
|
|
@ -102,10 +102,6 @@ sleep 15
|
||||||
|
|
||||||
git tag "$version"
|
git tag "$version"
|
||||||
|
|
||||||
# Commits need to be pushed to the remote so that "branched from" is correct
|
|
||||||
remote="$(git config zulip.zulipRemote)" || remote=upstream
|
|
||||||
git push "$remote" "$branch:$branch"
|
|
||||||
|
|
||||||
OUTPUT_DIR=$(mktemp -d)
|
OUTPUT_DIR=$(mktemp -d)
|
||||||
export OUTPUT_DIR
|
export OUTPUT_DIR
|
||||||
|
|
||||||
|
@ -119,6 +115,9 @@ fi
|
||||||
|
|
||||||
./tools/upload-release "$TARBALL"
|
./tools/upload-release "$TARBALL"
|
||||||
|
|
||||||
|
# Push the commits
|
||||||
|
remote="$(git config zulip.zulipRemote)" || remote=upstream
|
||||||
|
git push "$remote" "$branch:$branch"
|
||||||
git push "$remote" "$version"
|
git push "$remote" "$version"
|
||||||
|
|
||||||
# Upload to Github
|
# Upload to Github
|
||||||
|
|
Loading…
Reference in New Issue