packaging: Change update-version to push-new-version
- It also pushes changes and the new tag. - It was easy to forget to push the new tag.
This commit is contained in:
parent
6a9e800b3b
commit
be29bf124a
1 changed files with 3 additions and 0 deletions
27
packaging/push-new-version
Executable file
27
packaging/push-new-version
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/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
|
||||
else
|
||||
git grep -l $CURRENT_VERSION | xargs sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g"
|
||||
git diff
|
||||
git commit --all --message="Update version to $NEW_VERSION"
|
||||
fi
|
||||
git tag $NEW_VERSION
|
||||
git log --max-count=1
|
||||
git push
|
||||
git push --tags
|
||||
Loading…
Add table
Add a link
Reference in a new issue