Add release.sh for patch version bumping
Build / build (push) Successful in 13s

This commit is contained in:
Arne Weiss
2026-06-01 08:17:18 +02:00
parent d838a4dcc0
commit b3547946cc
3 changed files with 33 additions and 2 deletions
Executable
+29
View File
@@ -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"