Skip to content

Commit 7766127

Browse files
committed
updated deployment and version
1 parent e65ff5b commit 7766127

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

deploy.sh

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
MESSAGE="0"
1+
# src https://gist.github.com/mcguffin/746afffa0929ca8e2ea2ba8538776742
22

3-
VERSION=`cat src/mercutio/_version.py` | grep -q ^__version__ = \"\d.\d.\d\"
3+
REGEX="[0-9]\.[0-9]\.[0-9]"
4+
VERSION=`grep -o "$REGEX" src/mercutio/_version.py`
5+
6+
MESSAGE=$(printf "Release of version %s" $VERSION)
47

58
DRAFT="false"
69
PRE="false"
@@ -18,30 +21,7 @@ fi
1821
REPO_NAME=$(basename -s .git $REPO_REMOTE)
1922
REPO_OWNER=$(git config --get user.name)
2023

21-
# get args
22-
while getopts v:m:b:draft:pre: option
23-
do
24-
case "${option}"
25-
in
26-
v) VERSION="$OPTARG";;
27-
m) MESSAGE="$OPTARG";;
28-
b) BRANCH="$OPTARG";;
29-
draft) DRAFT="true";;
30-
pre) PRE="true";;
31-
esac
32-
done
33-
if [ $VERSION == "0" ]; then
34-
echo "Usage: git-release -v <version> [-b <branch>] [-m <message>] [-draft] [-pre]"
35-
exit 1
36-
fi
37-
38-
# set default message
39-
if [ "$MESSAGE" == "0" ]; then
40-
MESSAGE=$(printf "Release of version %s" $VERSION)
41-
fi
42-
43-
44-
API_JSON=$(printf '{"tag_name": "v%s","target_commitish": "%s","name": "v%s","body": "%s","draft": %s,"prerelease": %s}' "$VERSION" "$BRANCH" "$VERSION" "$MESSAGE" "$DRAFT" "$PRE" )
24+
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "%s","name": "mercutio %s","body": "%s","draft": %s,"prerelease": %s}' "$VERSION" "$BRANCH" "$VERSION" "$MESSAGE" "$DRAFT" "$PRE" )
4525
API_RESPONSE_STATUS=$(curl --data "$API_JSON" -s -i https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases?access_token=$GITHUB_ACCESS_TOKEN)
4626
echo "$API_RESPONSE_STATUS"
4727

src/mercutio/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.3"
1+
__version__ = "0.8.4"

0 commit comments

Comments
 (0)