-
Notifications
You must be signed in to change notification settings - Fork 4
/
release.sh
executable file
·53 lines (45 loc) · 1.1 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
#!/bin/bash
set -e
# set -x
SCRIPTPATH="$(
cd "$(dirname "$0")"
pwd -P
)"
cd $SCRIPTPATH
readme() {
echo "Generating README.md";
cat "./BASE.md" > "./README.md"
echo -e "\n\n" >> "./README.md"
cat "./src/http/README.md" >> "./README.md"
echo -e '\n# License\n\n```\n' >> "./README.md"
cat "./LICENSE" >> "./README.md"
echo -e '\n```\n' >> "./README.md"
}
release_tag() {
echo "Creating IWNET 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 '/^iwnet.*/d' | sed '/^\s*$/d'`
git add ./Changelog
git add ./README.md
if ! git diff-index --quiet HEAD --; then
git commit -a -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