eris/packaging/update-version
Andrew Hamilton 9273e3cdec 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.
2021-12-22 11:26:12 +10:00

20 lines
480 B
Bash
Executable file

#!/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