-
Notifications
You must be signed in to change notification settings - Fork 10
/
version_updater.sh
executable file
·134 lines (115 loc) · 4.13 KB
/
version_updater.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
echo "This is a command line tool to help you release new pyart/pyrad version"
echo "Please confirm that you are on master branch and you have added and commit all modifications you want to include in the tag in the master branch!"
echo "Type enter to continue"
read continue
#####################################################
# PyART
#####################################################
dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
echo Do you want to release a new pyART version y/n?
read updatepyart
if [[ $updatepyart == "y" ]]; then
echo "Please provide version number, for example 0(major).5(minor).0(micro)"
echo "What is the major version?"
read major
echo "What is the minor version?"
read minor
echo "What is the micro version?"
read micro
cd $dir
echo "Version number is $major.$minor.$micro"
echo "Updating setup.py"
sed -i "/MAJOR =/c\MAJOR = $major" $dir/src/pyart/setup.py
sed -i "/MINOR =/c\MINOR = $minor" $dir/src/pyart/setup.py
sed -i "/MICRO =/c\MICRO = $micro" $dir/src/pyart/setup.py
echo "Updating /doc/source/conf.py"
sed -i "/version = u/c\version = u'$major.$minor'" $dir/src/pyart/doc/source/conf.py
sed -i "/release = u/c\release = u'$major.$minor.$micro'" $dir/src/pyart/doc/source/conf.py
cd $dir/src/pyart/
echo "Done!"
echo "We will now push the version number updated on github"
git add --all
git commit -m "Changed version numbers"
git push origin master
echo "Do you want to push the new tag on github? y/n"
read pushtag
if [[ $pushtag == "y" ]]; then
git tag "v${major}.${minor}.${micro}"
git push origin "v${major}.${minor}.${micro}"
fi
echo "Done!"
echo "Do you want to create a new PyPI (pip) package? y/n"
read releasepypi
if [[ $releasepypi == "y" ]]; then
rm -r dist
python setup.py sdist
echo "Should it be a test package or a final (official) package? test/final"
read pkgtype
if [[ $pkgtype == "test" ]]; then
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
echo "You can now install pkg with pip install --index-url https://test.pypi.org/simple/ --no-deps pyart-mch"
echo "Install a fresh virtual env to test it with"
echo "python –m venv pyart_testing"
echo "source pyart_testing/bin/activate"
fi
if [[ $pkgtype == "final" ]]; then
python -m twine upload dist/*
fi
fi
echo "Done!"
fi
#####################################################
# PyRAD
#####################################################
cd $dir
echo Do you want to release a new pyRAD version y/n?
read updatepyrad
if [[ "$updatepyrad" == "y" ]]; then
echo "Please provide version number, for example 0(major).5(minor).0(micro)"
echo "What is the major version?"
read major
echo "What is the minor version?"
read minor
echo "What is the micro version?"
read micro
cd $dir
echo "Version number is $major.$minor.$micro"
echo "Updating setup.py"
sed -i "/MAJOR =/c\MAJOR = $major" ./src/pyrad_proc/setup.py
sed -i "/MINOR =/c\MINOR = $minor" ./src/pyrad_proc/setup.py
sed -i "/MICRO =/c\MICRO = $micro" ./src/pyrad_proc/setup.py
echo "Updating /doc/source/conf.py"
sed -i "/version = u/c\version = u'$major.$minor'" ./doc/source/conf.py
sed -i "/release = u/c\release = u'$major.$minor.$micro'" ./doc/source/conf.py
echo "We will now push the version number updated on github"
git add --all
git commit -m "Changed version numbers"
git push origin master
echo "Done!"
echo "Do you want to push the new tag on github? y/n"
read pushtag
if [[ $pushtag == "y" ]]; then
git tag "v${major}.${minor}.${micro}"
git push origin "v${major}.${minor}.${micro}"
fi
echo "Do you want to create a new PyPI (pip) package? y/n"
read releasepypi
if [[ $releasepypi == "y" ]]; then
cd $dir/src/pyrad_proc/
rm -r dist
python setup.py sdist
echo "Should it be a test package or a final (official) package? test/final"
read pkgtype
if [[ $pkgtype == "test" ]]; then
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
echo "You can now install pkg with pip install --index-url https://test.pypi.org/simple/ --no-deps pyrad-mch"
echo "Install a fresh virtual env to test it with"
echo "python –m venv pyrad_testing"
echo "source pyrad_testing/bin/activate"
fi
if [[ $pkgtype == "final" ]]; then
python -m twine upload dist/*
fi
fi
fi