-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·51 lines (42 loc) · 1.16 KB
/
publish.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
#!/bin/bash
RELEASE="${1:-SNAPSHOT}"
ARCNAME="qjackrcd-bin-${RELEASE}"
echo "### Clean all"
rm *.tar.gz &>/dev/null
rm -rf ".tmp" &>/dev/null
make distclean &>/dev/null
echo "### Make release ${RELEASE} from scratch"
qmake -config release
make
#make doxy
echo "### Make tar file ${ARCNAME}.tar.gz"
mkdir -p ".tmp/${ARCNAME}"
cp -r * -r .tmp/${ARCNAME}
cd .tmp
tar -czf "../${ARCNAME}.tar.gz" "${ARCNAME}"
cd ..
rm -rf ".tmp"
if [[ "${RELEASE}" == "SNAPSHOT" ]]
then
echo "### Commit in GIT"
git commit -m "prepare ${RELEASE}" -a
git push
echo "### Remove ${RELEASE} tag in GIT"
git tag -d ${RELEASE}
git push origin :${RELEASE}
echo "### Make ${RELEASE} tag in GIT"
git tag -a "${RELEASE}" -m "publish ${RELEASE}"
git push --tags
elif [[ "${RELEASE}" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]
then
echo "### Commit in GIT"
git commit -m "prepare v${RELEASE}" -a
git push
echo "### Make v${RELEASE} tag in GIT"
git tag -a "v${RELEASE}" -m "publish v${RELEASE}"
git push --tags
#elif [[ "${RELEASE}" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:alpha:]]+$ ]]
#then
#not managed yet with git
fi
echo "### Done."