-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathcreate-release
executable file
·51 lines (41 loc) · 1.02 KB
/
create-release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# Copyright © Michal Čihař <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e
if [ "$1" = "--help" ] || [ "$1" = "-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
DO_TAG=0
if [ "$1" = "--tag" ]; then
DO_TAG=1
shift
fi
# What are we going to build?
if [ "$DO_TAG" -eq 1 ]; then
./scripts/prepare-release
# Grab version
version=$(sed -n '/^VERSION =/ s/.*"\(.*\)"/\1/p' weblate/utils/version.py)
namever="weblate-$version"
# Tag release
git tag -s "$namever" -m "Version $version"
cd ~/weblate/test
git pull -q
git tag -s "$namever" -m "Test data for version $version"
cd ~/weblate/weblate
# Push git tags
git push --tags
cd ~/weblate/test
git push --tags
cd ~/weblate/weblate
# Update stable branch
git checkout stable
git merge "$namever"
git push origin stable
git checkout main
fi