blob: 22af0982f499d0f5c58aa0c3478b9e322d28af1d (
plain)
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
|
#!/bin/bash
set -e
project="razercfg"
basedir="$(dirname "$0")"
[ "${basedir:0:1}" = "/" ] || basedir="$PWD/$basedir"
origin="$basedir/.."
version="$(cat $origin/ui/pyrazer.py | grep -e RAZER_VERSION | head -n1 | cut -d'"' -f2)"
if [ -z "$version" ]; then
echo "Could not determine version!"
exit 1
fi
release_name="$project-$version"
tarball="$release_name.tar.bz2"
tagname="release-$version"
tagmsg="$project-$version release"
export GIT_DIR="$origin/.git"
cd /tmp/
rm -Rf "$release_name" "$tarball"
echo "Creating target directory"
mkdir "$release_name"
cd "$release_name"
echo "git checkout"
git checkout -f
rm scripts/makerelease.sh .gitignore
rm -R firmware #XXX Remove it for now...
echo "creating tarball"
cd ..
tar cjf "$tarball" "$release_name"
mv "$tarball" "$origin"
echo "running testbuild"
cd "$release_name"
cmake .
make
echo "removing testbuild"
cd ..
rm -R "$release_name"
echo "Tagging GIT"
cd "$origin"
git tag -m "$tagmsg" -a "$tagname"
echo
echo "built release $version"
|