forked from x42/harvid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·148 lines (115 loc) · 3.46 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/bin/bash
#environment variables
: ${OSXMACHINE:=priroda.local}
: ${COWBUILDER:=opendaw.local}
NEWVERSION=$1
if test -n "$(echo "$NEWVERSION" | sed 's/^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$//')"; then
NEWVERSION=""
fi
if test -z "$NEWVERSION"; then
echo -n "No X.X.X version given as argument. Do a binary build only? [y/N] "
read -n1 a
echo
if test "$a" != "y" -a "$a" != "Y"; then
exit 1
fi
fi
if test -n "$NEWVERSION"; then
echo "commit pending changes.."
git commit -a
dch --newversion "${NEWVERSION}-0.1" --distribution unstable || exit
vi ChangeLog
make VERSION="v${NEWVERSION}" clean man || exit
git status -s
echo " - Version v${NEWVERSION}"
echo -n "git commit and tag? [Y/n]"
read -n1 a
echo
if test "$a" == "n" -o "$a" == "N"; then
exit 1
fi
git commit -m "finalize changelog" debian/changelog ChangeLog doc/harvid.1
git tag "v${NEWVERSION}"
echo -n "git push and build? [Y/n] "
read -n1 a
echo
if test "$a" == "n" -o "$a" == "N"; then
exit 1
fi
git push origin && git push origin --tags
git push rg42 && git push rg42 --tags
fi
VERSION=$(git describe --tags HEAD)
test -n "$VERSION" || exit
/bin/ping -q -c1 ${OSXMACHINE} &>/dev/null \
&& /usr/sbin/arp -n ${OSXMACHINE} &>/dev/null
ok=$?
if test "$ok" != 0; then
echo "OSX build host can not be reached."
exit
fi
/bin/ping -q -c1 ${COWBUILDER} &>/dev/null \
&& /usr/sbin/arp -n ${COWBUILDER} &>/dev/null
ok=$?
if test "$ok" != 0; then
echo "Linux cowbuild host can not be reached."
exit
fi
echo "building win32 ..."
./x-win32.sh || exit
echo "building linux static ..."
ssh $COWBUILDER ~/bin/build-harvid.sh
ok=$?
if test "$ok" != 0; then
echo "remote build failed"
exit
fi
rsync -Pa $COWBUILDER:/tmp/harvid-i386-linux-gnu-${VERSION}.tgz site/releases/ || exit
rsync -Pa $COWBUILDER:/tmp/harvid-x86_64-linux-gnu-${VERSION}.tgz site/releases/ || exit
echo "building osx package on $OSXMACHINE ..."
ssh $OSXMACHINE << EOF
exec /bin/bash -l
cd src/harvid || exit 1
git pull || exit 1
git fetch --tags || exit 1
./x-macosx.sh
EOF
ok=$?
if test "$ok" != 0; then
echo "remote build failed"
exit
fi
rsync -Pa $OSXMACHINE:Desktop/mydmg/harvid-${VERSION}.pkg site/releases/ || exit
rsync -Pa $OSXMACHINE:Desktop/mydmg/harvid-${VERSION}.dmg site/releases/ || exit
rsync -Pa $OSXMACHINE:Desktop/mydmg/harvid-osx-${VERSION}.tgz tmp/ || exit
echo -n "${VERSION}" > site/releases/harvid_version.txt
echo "preparing website"
# git clone --single-branch -b gh-pages site
sed 's/@VERSION@/'$VERSION'/g;s/@DATE@/'"`date -R`"'/g;' site/index.tpl.html > site/index.html || exit
groff -m mandoc -Thtml doc/harvid.1 > site/harvid.1.html
cd site || exit
git add harvid.1.html releases/harvid_version.txt
git add releases/*-${VERSION}.* || exit
rm -f $(ls releases/* | grep -v "${VERSION}\." | grep -v harvid_version.txt | tr '\n' ' ')
git commit -a --amend -m "website $VERSION" || exit
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
echo -n "git upload site and binaries? [Y/n] "
read -n1 a
echo
if test "$a" == "n" -o "$a" == "N"; then
exit 1
fi
echo "uploading to github.."
git push --force
echo "uploading to ardour.org"
rsync -Pa \
../tmp/harvid-osx-${VERSION}.tgz \
releases/harvid-${VERSION}.dmg \
releases/harvid-${VERSION}.pkg \
releases/harvid-i386-linux-gnu-${VERSION}.tgz \
releases/harvid-x86_64-linux-gnu-${VERSION}.tgz \
releases/harvid_installer-${VERSION}.exe \
releases/harvid_version.txt \
ardour.org:/persist/community.ardour.org/files/video-tools/