Debian Codegraph @

utils/prepare-release

raw
1 #! /bin/sh
2
3 # A small script file to help release a new version of ctioga2
4
5 version="$1"
6
7 tmpdir=$(mktemp -d)
8 curdir=`pwd`
9 base=ctioga2-$version
10 cd $tmpdir
11 echo "Exporting tagged version"
12 git clone $curdir "$base"
13 cd "$base"
14 git checkout $version || exit 1
15 cat <<EOF > lib/ctioga2/version.rb
16 # Automatically generated file.
17 module CTioga2
18
19 module Version
20 EOF
21 echo "GIT_VERSION = '$version'" >> lib/ctioga2/version.rb
22 echo "GIT_DATE = '$(date)'" >> lib/ctioga2/version.rb
23 cat <<EOF >> lib/ctioga2/version.rb
24 end
25 end
26 EOF
27 rm -rf .git
28 (cd ..; tar cvjf "$base".tar.bz2 "$base" )
29 gem build ctioga2.gemspec
30 cd $curdir
31 cp -v $tmpdir/"$base".tar.bz2 $tmpdir/"$base"/"$base".gem .