#!/bin/bash

# generate-upload-instructions-release.sh - Generate manual upload instructions for Hello Elementor theme

set -e

# Get current version
PACKAGE_VERSION=$(node -p "require('./package.json').version")
# Use hardcoded hello-theme prefix for GitHub releases (different from package.json name)
BUILD_ZIP="hello-theme-${PACKAGE_VERSION}.zip"

echo "📋 **Hello Elementor v${PACKAGE_VERSION} - Manual Upload Instructions**"
echo ""
echo "==================================================================="
echo "🚀 RELEASE PREPARATION COMPLETE!"
echo "==================================================================="
echo ""
echo "📦 **Package Details:**"
echo "   - Theme: Hello Elementor"
echo "   - Version: v${PACKAGE_VERSION}"
echo "   - Build File: ${BUILD_ZIP}"
echo "   - GitHub Package: ${BUILD_ZIP}"
echo ""
echo "📋 **Manual Upload Steps:**"
echo ""
echo "1. **Download Release Package:**"
echo "   - Go to GitHub Releases page"
echo "   - Download: ${BUILD_ZIP}"
echo "   - Verify file integrity and size"
echo ""
echo "2. **WordPress.org Upload:**"
echo "   - Log into WordPress.org developer account"
echo "   - Navigate to Hello Elementor theme page"
echo "   - Upload the ${BUILD_ZIP} file"
echo "   - Update theme description and changelog"
echo ""
echo "3. **Update Theme Repository:**"
echo "   - Update theme directory README"
echo "   - Verify theme screenshots and assets"
echo "   - Update theme tags and compatibility"
echo ""
echo "4. **Post-Release Tasks:**"
echo "   - Test theme installation from WordPress.org"
echo "   - Update documentation and support materials"
echo "   - Announce release on social media and forums"
echo "   - Monitor for user feedback and issues"
echo ""
echo "⚠️  **Important Notes:**"
echo "   - WordPress.org themes cannot be auto-published"
echo "   - Manual review may be required by WordPress.org team"
echo "   - Allow 24-48 hours for theme directory updates"
echo "   - Keep GitHub release as backup distribution method"
echo ""
echo "✅ **Verification Checklist:**"
echo "   □ Package downloaded successfully"
echo "   □ Theme uploaded to WordPress.org"
echo "   □ Theme description updated"
echo "   □ Changelog entries correct"
echo "   □ Theme tags and compatibility updated"
echo "   □ Installation tested from WordPress.org"
echo "   □ Release announced on appropriate channels"
echo ""
echo "🔗 **Quick Links:**"
echo "   - GitHub Release: https://github.com/elementor/hello-theme/releases/tag/v${PACKAGE_VERSION}"
echo "   - WordPress.org: https://wordpress.org/themes/hello-elementor/"
echo ""
echo "==================================================================="
echo "For questions or issues, contact the development team."
echo "==================================================================="
