Skip to content

Commit 55ead44

Browse files
committed
Enhance release script to update version format and add GitHub release creation
1 parent a47a2b2 commit 55ead44

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

release.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ TAG="v$VERSION"
1515
sed -i '' "s/^Stable tag: .*/Stable tag: $VERSION/" readme.txt
1616

1717
# Update version in main plugin file
18-
sed -i '' "s/^\(\*\s*Version:\s*\).*/\1$VERSION/" webhookarm.php
18+
sed -i '' "s/^[[:space:]]*\**[[:space:]]*Version:[[:space:]]*.*/ * Version: $VERSION/" webhookarm.php
19+
sed -i '' "s/^\(.*BONO_ARM_WEBHOOK_VERSION', '\)[^']*\('.*\)$/\1$VERSION\2/" webhookarm.php
1920

2021
# Git add and commit
2122
git add readme.txt webhookarm.php
@@ -24,4 +25,12 @@ git push origin main
2425

2526
echo "✅ Version updated to $VERSION and pushed to main."
2627
echo "⏳ Waiting for GitHub Action to auto-tag version $TAG..."
27-
echo "👉 Monitor progress at: https://github.com/renatobo/WebHookARM/actions"
28+
echo "👉 Monitor progress at: https://github.com/renatobo/WebHookARM/actions"
29+
30+
# Create GitHub release using gh CLI
31+
if command -v gh &> /dev/null; then
32+
CHANGELOG=$(git log "$(git describe --tags --abbrev=0)..HEAD" --pretty=format:"- %s" --no-merges)
33+
gh release create "$TAG" --title "WebHookARM $VERSION" --notes "$CHANGELOG" || echo "⚠️ GitHub release creation failed or already exists."
34+
else
35+
echo "⚠️ GitHub CLI (gh) not found. Skipping release creation."
36+
fi

0 commit comments

Comments
 (0)