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
|
#! /bin/sh
# A small script file to help release a new version of ctioga2
version="$1"
tmpdir=$(mktemp -d)
curdir=`pwd`
base=ctioga2-$version
cd $tmpdir
echo "Exporting tagged version"
git clone $curdir "$base"
cd "$base"
git checkout $version || exit 1
cat <<EOF > lib/ctioga2/version.rb
# Automatically generated file.
module CTioga2
module Version
EOF
echo "GIT_VERSION = '$version'" >> lib/ctioga2/version.rb
echo "GIT_DATE = '$(date)'" >> lib/ctioga2/version.rb
cat <<EOF >> lib/ctioga2/version.rb
end
end
EOF
rm -rf .git
(cd ..; tar cvjf "$base".tar.bz2 "$base" )
gem build ctioga2.gemspec
cd $curdir
cp -v $tmpdir/"$base".tar.bz2 $tmpdir/"$base"/"$base".gem .
|