-
Notifications
You must be signed in to change notification settings - Fork 7
/
release.sh
executable file
·178 lines (151 loc) · 4.28 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#/bin/bash
# update version in
# - configure.ac
# - ChangeLog
# - doc/pages/whatsnew.html
: ${SFUSER:=}
: ${OSXUSER:=}
: ${COWBUILDER:=cowbuilder.local} # linux/windows (mingw)
: ${OSXMACHINE:=oscbuilder.local} # 10.6 (i386/x86)
: ${MACMACHINE:=macbuilder.local} # 11.0 (arm)
test -f "$HOME/.buildcfg.sh" && . "$HOME/.buildcfg.sh"
if test -z "$BINARYONLY"; then
make clean
sh autogen.sh
./configure --enable-contrib --enable-weakjack
VERSION=$(awk '/define VERSION /{print $3;}' config.h | sed 's/"//g')
WINVERS=$(grep " VERSION " config.h | cut -d ' ' -f3 | sed 's/"//g'| sed 's/\./_/g')
make REV="v$VERSION" # update binaries for help2man.
make -C doc man html
make clean
make dist
git commit -a
git tag "v$VERSION" || (echo -n "version tagging failed. - press Enter to continue, CTRL-C to stop."; read; )
echo -n "git push? [Y/n] "
read -n1 a
echo
if test "$a" = "n" -o "$a" = "N"; then
exit 1
fi
# upload to rg42.org git
git push rg42
git push rg42 --tags
# upload to github git
git push github
git push --tags github
#upload doc to sourceforge
sftp $SFUSER,[email protected] << EOF
cd htdocs/
rm *
lcd doc/html
mput -P -r *
chmod 0664 *.*
chmod 0664 static/*.*
chmod 0664 static/lb/*.*
chmod 0664 static/js/*.*
EOF
#upload source to sourceforge
sftp $SFUSER,[email protected] << EOF
cd /home/frs/project/x/xj/xjadeo/xjadeo
mkdir v${VERSION}
cd v${VERSION}
put xjadeo-${VERSION}.tar.gz
EOF
fi
## build binaries..
VERSION=$(awk '/define VERSION /{print $3;}' config.h | sed 's/"//g')
WINVERS=$(grep " VERSION " config.h | cut -d ' ' -f3 | sed 's/"//g'| sed 's/\./_/g')
if [ -z "$VERSION" ]; then
echo "unknown VERSION number"
exit 1;
fi
if test -n "$NOUPLOAD"; then
echo -n "build ? [Y/n] "
else
echo -n "build and upload? [Y/n] "
fi
read -n1 a
echo
if test "$a" == "n" -o "$a" == "N"; then
exit 1
fi
/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 linux static and windows versions"
rm -f /tmp/xjadeo-*.tgz
rm -f /tmp/xjadeo_win-*.tar.xz
ssh $COWBUILDER ~/bin/build-xjadeo.sh
ok=$?
if test "$ok" != 0; then
echo "remote build failed"
exit
fi
if test -n "$OSXFROMSCRATCH"; then
echo "building osx package from scratch"
ssh ${OSXUSER}${OSXMACHINE} << EOF
exec /bin/bash -l
curl -L -o /tmp/xjadeo-x-pbuildstatic.sh https://raw.github.com/x42/xjadeo/master/x-osx-buildstack.sh
chmod +x /tmp/xjadeo-x-pbuildstatic.sh
/tmp/xjadeo-x-pbuildstatic.sh
EOF
else
echo "building osx package with existing stack"
ssh ${OSXUSER}${OSXMACHINE} << EOF
exec /bin/bash -l
rm -rf xjadeo
git clone -b master --single-branch https://github.com/x42/xjadeo.git
cd xjadeo
./x-osx-bundle.sh
cd ..
rm -rf xjadeo
EOF
fi
ok=$?
if test "$ok" != 0; then
echo "remote build failed"
exit
fi
ssh $MACMACHINE ./bin/build-jadeo.sh
ok=$?
if test "$ok" != 0; then
echo "remote build failed"
exit
fi
# collect binaries from build-hosts
rsync -Pa $COWBUILDER:/tmp/xjadeo-i386-linux-gnu-v${VERSION}.tgz /tmp/ || exit
rsync -Pa $COWBUILDER:/tmp/xjadeo-x86_64-linux-gnu-v${VERSION}.tgz /tmp/ || exit
rsync -Pa $COWBUILDER:/tmp/xjadeo_installer_w32_v${WINVERS}.exe /tmp/ || exit
rsync -Pa $COWBUILDER:/tmp/xjadeo_installer_w64_v${WINVERS}.exe /tmp/ || exit
rsync -Pa $COWBUILDER:/tmp/xjadeo_w32-v${VERSION}.tar.xz /tmp/ || exit
rsync -Pa $COWBUILDER:/tmp/xjadeo_w64-v${VERSION}.tar.xz /tmp/ || exit
rsync -Pa ${OSXUSER}${OSXMACHINE}:/tmp/Jadeo-${VERSION}.dmg /tmp/jadeo-${VERSION}.dmg || exit
rsync -Pa ${MACMACHINE}:/tmp/Jadeo-arm64-${VERSION}.dmg /tmp/jadeo-arm64-${VERSION}.dmg || exit
if test -n "$NOUPLOAD"; then
exit
fi
#upload files to sourceforge
sftp $SFUSER,[email protected] << EOF
cd /home/frs/project/x/xj/xjadeo/xjadeo
mkdir v${VERSION}
cd v${VERSION}
put /tmp/xjadeo_installer_w32_v${WINVERS}.exe
put /tmp/xjadeo_installer_w64_v${WINVERS}.exe
put /tmp/xjadeo-i386-linux-gnu-v${VERSION}.tgz
put /tmp/xjadeo-x86_64-linux-gnu-v${VERSION}.tgz
put /tmp/jadeo-${VERSION}.dmg
put /tmp/jadeo-arm64-${VERSION}.dmg
EOF
# custom upload hook
test -x x-releasestatic.sh && ./x-releasestatic.sh