Skip to content

Commit

Permalink
get version from file with version from git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
andgineer committed Jul 24, 2020
1 parent 1235b46 commit ef43017
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion bombard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
__version__ = '1.20.1'
import bombard.version


__version__ = bombard.version.VERSION


def version():
Expand Down
1 change: 0 additions & 1 deletion bombard/version

This file was deleted.

1 change: 1 addition & 0 deletions bombard/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = '1.20.1'
7 changes: 4 additions & 3 deletions verup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Increments version git tag
# Saves it into VERSION_FILE

VERSION_FILE="bombard/version"
VERSION_FILE="bombard/version.py"

TAG=$(git describe --tags)

Expand Down Expand Up @@ -41,7 +41,7 @@ fi

NEW_TAG=$(echo "$major.$minor.$build")
echo -e "New : \033[32m$NEW_TAG\033[39m"
echo -e "export const VERSION = '$NEW_TAG';" > $VERSION_FILE
echo -e "VERSION = '$NEW_TAG'" > $VERSION_FILE

COMMIT_MSG=$(git log $TAG..HEAD --format=oneline | awk '{$1=""; print $0}')
COMMIT_MSG=$(echo -e "\n$COMMIT_MSG\n")
Expand All @@ -50,9 +50,10 @@ echo "Changes:"
echo $COMMIT_MSG
echo

git add .
git add $VERSION_FILE
git commit -m "Version $NEW_TAG$COMMIT_MSG"

echo "...push"
git tag $NEW_TAG -m "$COMMIT_MSG"
git push origin $NEW_TAG
git push

0 comments on commit ef43017

Please sign in to comment.