release.sh 439 Bytes
Newer Older
inso's avatar
inso committed
1 2 3 4 5 6
#!/bin/bash

#__version__     = '0.20.1dev9'
current=`grep -P "__version__     = \'\d+.\d+.\d+(\w*)\'" duniterpy/__init__.py | grep -oP "\d+.\d+.\d+(\w*)"`
echo "Current version: $current"

inso's avatar
inso committed
7
if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+[0-9a-z]*$ ]]; then
inso's avatar
inso committed
8 9
  sed -i "s/__version__     = '$current'/__version__     = '$1'/g" duniterpy/__init__.py
  git commit duniterpy/__init__.py -m "$1"
inso's avatar
inso committed
10
  git tag "$1" -a -m "$1"
inso's avatar
inso committed
11 12 13
else
  echo "Wrong version format"
fi