mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-05-07 01:48:14 +08:00
55 lines
1.6 KiB
Bash
Executable file
55 lines
1.6 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ "x$1" = "x--help" -o "x$1" = "x-h" ] ; then
|
|
echo "Usage: ./scripts/create-release [--tag]"
|
|
exit 1
|
|
fi
|
|
|
|
if ! git diff --exit-code --quiet ; then
|
|
echo "There are not committed changes!"
|
|
exit 1
|
|
fi
|
|
|
|
# Grab version
|
|
version=`DJANGO_SETTINGS_MODULE=weblate.settings_example python -c 'import weblate; print weblate.VERSION_BASE'`
|
|
namever=weblate-$version
|
|
tarver=Weblate-$version
|
|
|
|
# What are we going to build?
|
|
if [ "x$1" = "x--tag" ] ; then
|
|
sed -i "s/^VERSION =.*/VERSION = '$version'/" weblate/__init__.py
|
|
sed -i "s/weblate-[0-9.]\\+/weblate-$version/" docs/admin/deployments.rst
|
|
if ! git diff --exit-code --quiet ; then
|
|
git commit -s -m "Releasing $version" -- weblate/__init__.py docs/admin/deployments.rst
|
|
fi
|
|
rev=$namever
|
|
git tag -s $rev -m "Version $version"
|
|
cd ~/weblate/test
|
|
git tag -s $rev -m "Test data for version $version"
|
|
cd ~/weblate/weblate
|
|
fi
|
|
|
|
# Compile po files
|
|
./scripts/generate-locales
|
|
|
|
# Create tarballs
|
|
fakeroot ./setup.py sdist
|
|
|
|
# Recompress tarballs
|
|
zcat dist/$tarver.tar.gz | xz > dist/$tarver.tar.xz
|
|
zcat dist/$tarver.tar.gz | bzip2 > dist/$tarver.tar.bz2
|
|
|
|
# Upload release
|
|
if [ "x$1" = "x--tag" ] ; then
|
|
# PyPi archive upload
|
|
twine upload --sign --identity 63CB1DF1EF12CF2AC0EE5A329C27B31342B7511D dist/$tarver*.tar.gz
|
|
|
|
# Sign remaining files
|
|
gpg --detach-sign --armor --local-user 63CB1DF1EF12CF2AC0EE5A329C27B31342B7511D dist/$tarver*.tar.xz
|
|
gpg --detach-sign --armor --local-user 63CB1DF1EF12CF2AC0EE5A329C27B31342B7511D dist/$tarver*.tar.bz2
|
|
|
|
# Download server
|
|
scp dist/Weblate-$version.tar.* web:/srv/http/dl.cihar.com/weblate/
|
|
fi
|