Skip to content
Snippets Groups Projects
Commit 017626bd authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Merge branch 'v2.1'

parents 2474df8a 5c8262a4
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
# use this script to make a new release
# just type ./release.sh
# and follow instructions
confirm () {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)
false
;;
esac
}
VALIDATED=
if [ "$1" = --validated ] ; then
VALIDATED=yes
fi
echo "*** Only use this script if you want to release a new PLUMED version ***"
echo "*** follow instructions below ***"
ls src README 1>/dev/null 2>/dev/null || {
echo "Launch from root directory"
exit 1
}
read -r -p "Type the version number (e.g. 2.1.3 or 2.2b): " version
case "$version" in
(2.?*)
version="${version#2.}"
;;
(*)
echo "ERROR"
echo "Use a version in form 2.*"
exit 1
;;
esac
shortversion=$(echo "$version" | sed 's/^\([0-9][0-9]*\).*/\1/' )
version=2.$version
shortversion=2.$shortversion
echo "major version v$shortversion"
echo "minor version v$version"
if test $version == $shortversion ; then
echo "ERROR"
echo "please add a patch identified so that tag and branch have different names"
exit 1
fi
if test "$(git tag -l | awk '{if($1=="'v$version'")print "yes"}')" == yes ; then
echo "tag v$version already exists"
exit 1
fi
set -e
if ! test "$VALIDATED" ; then
echo "checking out branch v$shortversion"
git checkout v$shortversion
echo
msg="Travis tests for v$version
[makedoc]"
echo "Now I will add an empty commit and push the result to origin"
echo "I will use the following commands:"
echo "***"
echo "git commit --allow-empty -m \"$msg\""
echo "git push origin v$shortversion"
echo "***"
confirm || exit
git commit --allow-empty -m "$msg"
git push origin v$shortversion
echo
echo "Now you should go at this link:"
echo " http://travis-ci.org/plumed/plumed2/builds"
echo "and wait for travis to finish the tests"
echo "In case of failures, fix and repeat the procedure"
echo "Also check the online manual, that should be here:"
echo " http://plumed.github.io/doc-v$shortversion"
echo "In case of success, relaunch this script as \"./release.sh --validated\""
else
echo "Updating VERSION file to $version"
{
grep \# VERSION
echo $version
} > VERSION.tmp
mv VERSION.tmp VERSION
git add VERSION
msg="Release v$version
[makedoc]"
echo "Now I will make the release commit, add a tag named v$version"
echo "push it to origin and create a tgz file"
echo "I will use the following commands:"
echo "***"
echo "git commit --allow-empty -m \"$msg\""
echo "git tag v$version"
echo "git push origin v$version"
echo "git archive -o plumed-$version.tgz --prefix plumed-$version/ v$version"
echo "***"
confirm || exit
git commit --allow-empty -m "$msg"
git tag v$version
git push origin v$version
git archive -o plumed-$version.tgz --prefix plumed-$version/ v$version
echo
echo "Done!"
echo
echo "Please upload the file plumed-$version.tgz on the download directory"
echo "Remember to notify the mailing list"
fi
#! /bin/bash
if [ "$1" = --description ] ; then
echo "create a tgz file containing a plumed release, only works from git repository"
exit 0
fi
if [ $# != 1 ] ;
then
echo "Syntax:"
echo "release.sh 2.0"
exit 1
fi
version=$1
case "$version" in
(2.?*)
version="${version#2.}"
;;
(*)
echo "ERROR"
echo "Use a version in form 2.*"
exit 1
;;
esac
ls src README 1>/dev/null 2>/dev/null || {
echo "Launch from root directory"
exit 1
}
shortversion=$(echo "$version" | sed 's/^\([0-9][0-9]*\).*/\1/' )
echo "Version: 2.$version"
echo "Short version: 2.$shortversion"
VERSION="
LONG: v2.$version
SHORT: v2.$shortversion
"
git archive -o plumed-2.$version.tgz --prefix plumed-2.$version/ v2.$version
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment