Add script to update version of eris.
- Globally replaces old version for new throughout the codebase, commits the change, then creates a tag for the new version at the head. - This is instead of magic code within setup.py that tries to pull the version from git at runtime. Also git isn't always available.
This commit is contained in:
parent
851a40dd1a
commit
9273e3cdec
1 changed files with 20 additions and 0 deletions
20
packaging/update-version
Executable file
20
packaging/update-version
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
# Script only runs at the codebase root.
|
||||
[ $(basename $PWD) == "eris" ]
|
||||
[ -e README.md ]
|
||||
|
||||
|
||||
NEW_VERSION=$(date "+%Y.%m.%d")
|
||||
CURRENT_VERSION=$(git describe --tags --abbrev=0)
|
||||
if [ $NEW_VERSION == $CURRENT_VERSION ]; then
|
||||
git tag --delete $CURRENT_VERSION
|
||||
else
|
||||
git grep -l $CURRENT_VERSION | xargs sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g"
|
||||
git commit --all --message="Update version from $CURRENT_VERSION to $NEW_VERSION."
|
||||
fi
|
||||
git tag $NEW_VERSION
|
||||
Loading…
Add table
Add a link
Reference in a new issue