-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2091cf5
commit 610dd8f
Showing
3 changed files
with
38 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,27 @@ git config --global user.email "[email protected]" | |
cd "$(git rev-parse --show-toplevel)" || exit | ||
|
||
# Extract version from project.godot | ||
VERSION=$(grep 'config/version=' project.godot | cut -d'=' -f2 | tr -d '"') | ||
VERSION=v$(grep 'config/version=' project.godot | cut -d'=' -f2 | tr -d '"') | ||
echo "VERSION: $VERSION" | ||
|
||
# Get the latest tag | ||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") | ||
echo "LATEST_TAG: $LATEST_TAG" | ||
|
||
# Create a new tag if the version has changed | ||
if [ "$VERSION" != "$LATEST_TAG" ]; then | ||
git tag -a "v$VERSION" -m "Release $VERSION" | ||
if git push origin "v$VERSION"; then | ||
echo "Created and pushed new tag v$VERSION" | ||
else | ||
echo "Failed to push tag v$VERSION" | ||
exit 1 | ||
fi | ||
else | ||
echo "Version unchanged. Current version: $VERSION" | ||
if [ "$VERSION" = "$LATEST_TAG" ]; then | ||
echo "Version unchanged. No new tag will be created." | ||
exit 0 | ||
fi | ||
|
||
if ! git tag -a "$VERSION" -m "Release $VERSION"; then | ||
echo "Failed to create tag $VERSION" | ||
exit 0 | ||
fi | ||
|
||
if ! git push origin "$VERSION"; then | ||
echo "Failed to push tag $VERSION" | ||
exit 0 | ||
fi | ||
|
||
echo "Created and pushed new tag $VERSION" |
This file contains 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
This file contains 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