-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtagwrath.sh
94 lines (76 loc) · 2.34 KB
/
tagwrath.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#! /bin/bash
if ! git-status | grep "nothing to commit (working directory clean)" > /dev/null
then
echo "---- Cannot tag, you have uncommitted changes ----"
exit 1
fi
if [ ! -f "README.textile" ]
then
echo "---- No README.textile found ----"
exit 1
fi
TOC="30000"
for toc in `/bin/find -name "*.toc"`
do
sed "s/\(.*\)Interface: .*/\1Interface: $TOC/" $toc > newtoc
mv newtoc $toc
git-add $toc
sleep 1
done
git commit -m "Updating TOC to $TOC"
lasttag=`git-describe --tags --abbrev=0 HEAD`
if [ $lasttag ]
then
echo "Last tag: $lasttag"
lastversion=`echo "$lasttag" | sed "s/\([0-9]*\).\([0-9]*\).\([0-9]*\).\(.*\)-.*/\4/"`
VER=$(($lastversion + 1))
else
echo "Cannot find last tags"
VER=1
fi
echo "Quality? "
read -e QUAL
version="3.0.1.$VER"
tagname="$version-$QUAL"
currentbranch=`sed "s/ref: refs\/heads\///" .git/HEAD`
addon=`pwd | sed "s/.*\///"`
touch changelog.txt
echo "$tagname" > thesechanges.txt
if [ $lasttag ]
then
git-log $lasttag..$currentbranch --no-merges --pretty=medium >> thesechanges.txt
else
git-log --no-merges --pretty=medium >> thesechanges.txt
fi
echo "" >> thesechanges.txt
cat changelog.txt >> thesechanges.txt
mv thesechanges.txt changelog.txt
scite changelog.txt
git-add changelog.txt
git-commit -m "Update changelog for $tagname"
git branch tagging
git checkout tagging
for toc in `/bin/find -name "*.toc"`
do
sed "s/\(.*\)Version: .*/\1Version: $version/" $toc > newtoc
mv newtoc $toc
git-add $toc
sleep 1
done
echo "This is a wrath build of $addon" > /c/Users/Tekkub/Desktop/$addon-$version-description.txt
echo "" >> /c/Users/Tekkub/Desktop/$addon-$version-description.txt
textile_to_wowi.rb >> /c/Users/Tekkub/Desktop/$addon-$version-description.txt
git-rm README.textile
git commit -m "Weekly build $tagname"
git-tag -a -m "Weekly build" $tagname
git checkout $currentbranch
git branch -D tagging
git-merge -s ours $tagname
git-archive --format=zip --prefix=$addon/ -9 $tagname > /c/Users/Tekkub/Desktop/$addon-$version.zip
cp changelog.txt /c/Users/Tekkub/Desktop/$addon-$version-changelog.txt
echo "Pushing to origin"
git-push --tags origin $currentbranch
echo ""
echo "Uploading to WoWI"
ruby /c/Users/Tekkub/bin/wowi_upload.rb "$addon (wrath)" $tagname /c/Users/Tekkub/Desktop/$addon-$version.zip /c/Users/Tekkub/Desktop/$addon-$version-changelog.txt /c/Users/Tekkub/Desktop/$addon-$version-description.txt --wrath
exit 0