eris/packaging/push-new-version
2024-12-11 22:20:21 +10:00

28 lines
671 B
Bash
Executable file

#!/bin/bash
set -e
# Only run at the codebase root.
[ -e .git ]
# Don't run with uncommited or staged changes.
git diff --exit-code
git diff --cached --exit-code
NEW_VERSION=$(date "+v%Y.%m.%d")
CURRENT_VERSION=$(git describe --tags --abbrev=0)
if [ $NEW_VERSION == $CURRENT_VERSION ]; then
git tag --delete $CURRENT_VERSION
git push --delete origin $CURRENT_VERSION
fi
git grep --no-color -l $CURRENT_VERSION | xargs sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g"
for DIR in eris fill3 lscolors termstr ; do
cd $DIR; uv sync; cd ..
done
git commit --all --message="Update version to $NEW_VERSION"
git tag $NEW_VERSION
git push
git push --tags
echo "Done."