This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
FILE=simple_withdrawalbutton.php
|
||||
|
||||
# Read current version
|
||||
CURRENT=$(grep "version = '" "$FILE" | grep -o "'[0-9]*\.[0-9]*\.[0-9]*'" | tr -d "'")
|
||||
if [ -z "$CURRENT" ]; then
|
||||
echo "Error: could not read version from $FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Increment patch
|
||||
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
|
||||
MINOR=$(echo "$CURRENT" | cut -d. -f2)
|
||||
PATCH=$(echo "$CURRENT" | cut -d. -f3)
|
||||
NEW="$MAJOR.$MINOR.$((PATCH + 1))"
|
||||
|
||||
echo "Version: $CURRENT → $NEW"
|
||||
|
||||
# Write new version into module file
|
||||
sed -i "s/version = '$CURRENT'/version = '$NEW'/" "$FILE"
|
||||
|
||||
# Commit, tag, push — triggers release pipeline on Gitea
|
||||
git add "$FILE"
|
||||
git commit -m "Bump version to $NEW"
|
||||
git tag "v$NEW"
|
||||
git push
|
||||
git push origin "v$NEW"
|
||||
Reference in New Issue
Block a user