forked from DMTF/python-redfish-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·38 lines (31 loc) · 841 Bytes
/
release.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
#!/bin/bash
# Collect change log info
CHANGES="## [$1] - $(date +'%Y-%m-%d')"$'\n'
echo "Enter changes:"
while : ; do
read CHANGE
if [ "$CHANGE" = "" ]; then
break
fi
CHANGES="$CHANGES- $CHANGE"$'\n'
done
# Rebase
git checkout master
git fetch && git rebase origin
# Update the version number in setup.py and src/redfish/__init__.py
sed -i -E 's/ version=.+,/ version='\'$1\'',/' setup.py
sed -i -E 's/__version__ = .+/__version__ = "'$1'"/' src/redfish/__init__.py
# Update the change log file
ex CHANGELOG.md <<eof
3 insert
$CHANGES
.
xit
eof
# Commit and push changes
git add CHANGELOG.md setup.py src/redfish/__init__.py
git commit -s -m "$1 versioning"
git push origin master
# Make new release in GitHub
CHANGES="Changes since last release:"$'\n\n'"$CHANGES"
gh release create $1 -n "$CHANGES"