-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·64 lines (54 loc) · 1.6 KB
/
release.sh
File metadata and controls
executable file
·64 lines (54 loc) · 1.6 KB
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
#!/usr/bin/env bash
set -e
usage() {
echo "usage: ./release.sh <version> <builddir> [--ignore-examples]"
exit 1
}
[[ $# -ge 2 ]] || usage
version="$1"
builddir="$2"
ignore_examples=0
if [[ $# -eq 3 ]]; then
if [[ "$3" == "--ignore-examples" ]]; then
ignore_examples=1
else
usage
fi
fi
branch=`git rev-parse --abbrev-ref HEAD`
if [[ $branch != "master" ]]; then
echo "must be on branch 'master'"
exit 1
fi
# check that examples work
if [[ $ignore_examples -ne 1 ]]; then
for lang in c d go haskell java js ocaml python rust swift v zig; do
( cd examples/$lang && ./__run_all.sh \
|| { echo "$lang examples failed"; exit 1; } )
done
fi
# checks for which there are no scripts yet
echo 'RUNME: cppcheck --enable=all --inconclusive --std=posix --quiet --force -I. src/'
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"'
# update version
old="[0-9]+(\.[0-9]+)*(\.dev)?"
new=$version
# edit version in configure.ac
lcontext="AC_INIT\(\[re2c\],\["
rcontext="\],\[re2c-general@lists\.sourceforge\.net\]\)"
sed -i -E "s/$lcontext$old$rcontext/$lcontext$new$rcontext/" configure.ac
# edit version in CMakeLists.txt
lcontext="project\(re2c VERSION "
rcontext=" "
sed -i -E "s/$lcontext$old$rcontext/$lcontext$new$rcontext/" CMakeLists.txt
# distcheck
build/__distcheck.sh "$builddir"
# 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