Created
July 21, 2020 08:34
-
-
Save swilly22/7822ccef96dfe04b873b4da776a34653 to your computer and use it in GitHub Desktop.
bump version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VERSION_H=./src/version.h | |
MAJOR=99 | |
MINOR=99 | |
PATCH=99 | |
DRYRUN=echo | |
read -r -p "dryrun? [Y/n]" input | |
if [ "$input" == "n" ]; then | |
unset DRYRUN | |
fi | |
echo version major | |
read MAJOR | |
echo version minor | |
read MINOR | |
echo version patch | |
read PATCH | |
$DRYRUN sed -i '' "s/#define REDISGRAPH_VERSION_MAJOR.*/#define REDISGRAPH_VERSION_MAJOR $MAJOR/g" $VERSION_H | |
$DRYRUN sed -i '' "s/#define REDISGRAPH_VERSION_MINOR.*/#define REDISGRAPH_VERSION_MINOR $MINOR/g" $VERSION_H | |
$DRYRUN sed -i '' "s/#define REDISGRAPH_VERSION_PATCH.*/#define REDISGRAPH_VERSION_PATCH $PATCH/g" $VERSION_H | |
echo creating bump version commit | |
$DRYRUN git add ./src/version.h | |
$DRYRUN git commit -m "Version bump" | |
echo tag version | |
$DRYRUN git tag "v$MAJOR.$MINOR.$PATCH" | |
echo push branch | |
$DRYRUN git push | |
echo push tag | |
$DRYRUN git push --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment