-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathupdate_version.sh
More file actions
executable file
·45 lines (34 loc) · 1.26 KB
/
update_version.sh
File metadata and controls
executable file
·45 lines (34 loc) · 1.26 KB
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
####################################################################################################
#
# How to update the version number:
#
# run: ./update_version 21.0.1 (for example)
#
# Software name:
package=packmol
# Release version, read from command line:
version="$1"
# Name of files containing version number
versionfile=./src/title.f90
fpmfile=./fpm.toml
pyprojfile=./pyproject.toml
####################################################################################################
if [[ $version < " " ]]; then
version=`grep version fpm.toml`
echo "ERROR: Please provide version number, with: ./release.sh 20.1.1"
echo " current $version"
exit
fi
cat $versionfile | sed -e "s/Version.*/Version\ $version \')\")/" > tmpfile.txt
\mv -f tmpfile.txt $versionfile
cat $fpmfile | sed -e "s/version.*/version = \"$version\"/" > tmpfile.txt
\mv -f tmpfile.txt $fpmfile
cat $pyprojfile | sed -e "s/version.*/version = \"$version\"/" > tmpfile.txt
\mv -f tmpfile.txt $pyprojfile
echo "----------------------"
echo "Please update the CHANGELOG.md file. Commits:"
echo "----------------------"
range=`git tag | sort -V | tail -n 2 | xargs | sed 's! !...!'`
git log --pretty=oneline $range | awk '{$1=""; print "-"$0}'
echo "----------------------"
echo " Done. "