forked from Softmotions/ejdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·57 lines (47 loc) · 1.31 KB
/
release.sh
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
52
53
54
55
#!/bin/bash
set -e
# set -x
cd `readlink -f "$0" | xargs dirname`
readme() {
echo "Generating README.md";
cat "./BASE.md" > "./README.md"
echo -e "\n\n" >> "./README.md"
cat "./src/bindings/ejdb2_android/README.md" >> "./README.md"
echo -e "\n\n" >> "./README.md"
cat "./src/jql/README.md" >> "./README.md"
echo -e "\n\n" >> "./README.md"
cat "./src/jbr/README.md" >> "./README.md"
echo -e "\n\n" >> "./README.md"
cat "./CAPI.md" >> "./README.md"
echo -e '\n# License\n```\n' >> "./README.md"
cat "./LICENSE" >> "./README.md"
echo -e '\n```\n' >> "./README.md"
}
release_tag() {
echo "Creating EJDB2 release"
readme
git pull origin master
dch --distribution testing --no-force-save-on-release --release "" -c ./Changelog
VERSION=`dpkg-parsechangelog -l./Changelog -SVersion`
TAG="v${VERSION}"
CHANGESET=`dpkg-parsechangelog -l./Changelog -SChanges | sed '/^ejdb2.*/d' | sed '/^\s*$/d'`
git add ./Changelog
git add ./README.md
if ! git diff-index --quiet HEAD --; then
git commit -m"${TAG} landed"
git push origin master
fi
echo "${CHANGESET}" | git tag -f -a -F - "${TAG}"
git push origin -f --tags
}
while [ "$1" != "" ]; do
case $1 in
"-d" ) readme
exit
;;
"-r" ) release_tag
exit
;;
esac
shift
done