Files
simple-withdrawalbutton/release.sh
T
Arne Weiss b3547946cc
Build / build (push) Successful in 13s
Add release.sh for patch version bumping
2026-06-01 08:17:18 +02:00

30 lines
723 B
Bash
Executable File

#!/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"