snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
This commit is contained in:
123
tools/build-release-tarball
Executable file
123
tools/build-release-tarball
Executable file
@@ -0,0 +1,123 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
# shellcheck source=lib/git-tools.bash
|
||||
. "$(dirname "$0")"/lib/git-tools.bash
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 <ZULIP_VERSION>" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
args="$(getopt -o '' -l 'help' -n "$0" -- "$@")"
|
||||
eval "set -- $args"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "${1:-}" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
version="$1"
|
||||
prefix="zulip-server-$version"
|
||||
|
||||
require_clean_work_tree 'build a release tarball'
|
||||
|
||||
set -x
|
||||
GITID=$(git rev-parse HEAD)
|
||||
|
||||
umask 022
|
||||
|
||||
OUTPUT_DIR=${OUTPUT_DIR:-$(mktemp -d)}
|
||||
TARBALL=$OUTPUT_DIR/$prefix.tar
|
||||
BASEDIR=$(pwd)
|
||||
|
||||
git archive -o "$TARBALL" "--prefix=$prefix/" HEAD
|
||||
|
||||
cd "$OUTPUT_DIR"
|
||||
tar -xf "$TARBALL"
|
||||
while read -r i; do
|
||||
rm -r --interactive=never "${OUTPUT_DIR:?}/$prefix/$i"
|
||||
done <"$OUTPUT_DIR/$prefix/tools/release-tarball-exclude.txt"
|
||||
tar -cf "$TARBALL" "$prefix"
|
||||
rm -rf "$prefix"
|
||||
|
||||
if tar -tf "$TARBALL" | grep -q -e ^zerver/tests; then
|
||||
set +x
|
||||
echo "BUG: Excluded files remain in tarball!"
|
||||
exit 1
|
||||
fi
|
||||
cd "$BASEDIR"
|
||||
|
||||
# Check out a temporary full copy of the index to generate static files
|
||||
git checkout-index -f -a --prefix "$OUTPUT_DIR/$prefix/"
|
||||
|
||||
# Add the Git version information file
|
||||
if [[ "$version" =~ ^[0-9]+\.[0-9]+(-[0-9a-z]+)?$ ]]; 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)
|
||||
if [ "$generated_version" != "$version" ]; then
|
||||
echo "Version $version looks like a release version, but is not tagged yet! Got $generated_version"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
./tools/cache-zulip-git-version
|
||||
fi
|
||||
mv zulip-git-version "$OUTPUT_DIR/$prefix/"
|
||||
|
||||
cd "$OUTPUT_DIR/$prefix"
|
||||
|
||||
env -u PYTHONDEVMODE -u PYTHONWARNINGS uv sync --frozen --no-managed-python
|
||||
|
||||
# create var/log directory in the new temporary checkout
|
||||
mkdir -p "var/log"
|
||||
|
||||
# Some settings need to be updated for update-prod-static to work
|
||||
#
|
||||
# TODO: Would be much better to instead run the below tools with some
|
||||
# sort of environment hack so that we don't need to create this dummy
|
||||
# secrets file.
|
||||
cat >>zproject/prod_settings_template.py <<EOF
|
||||
DEBUG = False
|
||||
EOF
|
||||
cat >>zproject/dev-secrets.conf <<EOF
|
||||
[secrets]
|
||||
local_database_password = ''
|
||||
secret_key = 'not_used_here'
|
||||
shared_secret = 'not_used_here'
|
||||
avatar_salt = 'not_used_here'
|
||||
rabbitmq_password = 'not_used_here'
|
||||
initial_password_salt = 'not_used_here'
|
||||
EOF
|
||||
|
||||
./tools/update-prod-static
|
||||
|
||||
# We don't need duplicate copies of emoji with hashed paths, and they would break Markdown
|
||||
find prod-static/serve/generated/emoji/images/emoji/ -regex '.*\.[0-9a-f]+\.png' -delete
|
||||
|
||||
echo "$GITID" >build_id
|
||||
echo "$version" >version
|
||||
|
||||
cd "$OUTPUT_DIR"
|
||||
|
||||
# We don't include starlight_help/dist_no_relative_links since that is only useful for zulip.com
|
||||
# and zulip.com doesn't use tarballs for deployment.
|
||||
tar --append -f "$TARBALL" "$prefix/prod-static" "$prefix/build_id" "$prefix/version" "$prefix/zulip-git-version" "$prefix/locale" "$prefix/staticfiles.json" "$prefix/webpack-stats-production.json" "$prefix/starlight_help/dist"
|
||||
|
||||
rm -rf "$prefix"
|
||||
|
||||
gzip "$TARBALL"
|
||||
|
||||
set +x
|
||||
TARBALL="$TARBALL.gz"
|
||||
|
||||
echo "Generated $TARBALL"
|
||||
Reference in New Issue
Block a user