forked from skvadrik/re2c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·51 lines (43 loc) · 1.54 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
#!/bin/bash
set -e
echo 'RUNME: configure CXX=include-what-you-use CXXFLAGS="--check-also" && make -k 2>log && python2 `which fix_inclydes.py` < log'
echo 'RUNME: cppcheck --enable=all --inconclusive --std=posix --quiet --force -I. src/'
echo 'RUNME: for h in $(find src/ -name ''*.h*''); do echo "CHECKING $h"; g++ -I. -c $h -o foo.o; done'
echo "RUNME: uselex `find <objdir> -type f -name '*.o'`"
echo 'RUNME: configure CFLAGS="-ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections -Wl,--print-gc-sections"'
echo 'RUNME: configure CXX=clang++'
echo 'RUNME: configure CXXFLAGS="-m32"'
echo 'RUNME: configure --host i686-w64-mingw32, test with wine: make wtests'
echo 'RUNME: configure CXXFLAGS="-fsanitize=address"'
echo 'RUNME: configure CXXFLAGS="-fsanitize=undefined"'
echo 'RUNME: valgrind: make vtests'
echo 'RUNME: skeleton: ./run_tests.sh --skeleton'
if [[ $# -ne 1 ]]
then
echo "usage: ./release.sh <version>"
exit 1
fi
version="$1"
branch=`git rev-parse --abbrev-ref HEAD`
if [[ $branch != "master" ]]
then
echo "must be on branch 'master'"
exit 1
fi
# edit version in re2c/configure.in
lcontext="AC_INIT\(\[re2c\],\["
rcontext="\],\[re2c-general@lists\.sourceforge\.net\]\)"
old="[0-9]+(\.[0-9]+)*(\.dev)?"
new=$version
sed -i -E "s/$lcontext$old$rcontext/$lcontext$new$rcontext/" re2c/configure.ac
# distcheck
builddir=.build
cd re2c && ./__distcheck.sh $builddir && cd ..
# commit release
git commit -a -m "Release $version."
git tag $version
for r in `git remote`
do
git push $r master
git push --tags $r master
done