Files
AzerothCore-RealmMaster/.github/workflows/create-release.yml
uprightbass360 61436263ad fix: resolve YAML syntax errors in create-release workflow
Replaced heredocs with echo statements to avoid YAML parsing issues.
The YAML parser was interpreting markdown headings and other content
within heredocs as YAML syntax, causing validation errors.

Using grouped echo statements ({ echo ...; } > file) works correctly
with GitHub Actions YAML parser while maintaining variable expansion.

Also updated documentation to use generic placeholder (your-dockerhub-username)
in examples instead of hardcoded username.
2026-01-10 18:16:29 -05:00

247 lines
10 KiB
YAML

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.0.0)'
required: true
type: string
profile:
description: 'Module profile for this release'
required: false
type: string
default: 'RealmMaster'
prerelease:
description: 'Mark as pre-release'
required: false
type: boolean
default: false
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare release variables
run: |
VERSION="${{ github.event.inputs.version }}"
PROFILE="${{ github.event.inputs.profile }}"
PROFILE_TAG=$(echo "${PROFILE}" | tr '[:upper:]' '[:lower:]' | tr '_' '-')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "PROFILE=${PROFILE}" >> $GITHUB_ENV
echo "PROFILE_TAG=${PROFILE_TAG}" >> $GITHUB_ENV
# Get build date from Docker Hub image (or use current date)
BUILD_DATE=$(date +%Y%m%d)
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
# Get AzerothCore commit from local-storage if available
if [ -d "local-storage/source/azerothcore-playerbots" ]; then
ACORE_COMMIT=$(cd local-storage/source/azerothcore-playerbots && git rev-parse --short HEAD)
else
ACORE_COMMIT="unknown"
fi
echo "ACORE_COMMIT=${ACORE_COMMIT}" >> $GITHUB_ENV
- name: Read module list from profile
run: |
PROFILE_FILE="config/module-profiles/${PROFILE}.json"
if [ ! -f "$PROFILE_FILE" ]; then
echo "ERROR: Profile file not found: $PROFILE_FILE"
exit 1
fi
# Extract module count
MODULE_COUNT=$(python3 -c "import json; data=json.load(open('$PROFILE_FILE')); print(len(data.get('modules', [])))")
echo "MODULE_COUNT=${MODULE_COUNT}" >> $GITHUB_ENV
# Extract modules for release notes
python3 -c "import json; data=json.load(open('$PROFILE_FILE')); print('\n'.join(['- ' + m for m in data.get('modules', [])]))" > modules.txt
- name: Create deployment package
run: |
PACKAGE_NAME="azerothcore-realmmaster-${VERSION}-${PROFILE_TAG}"
mkdir -p "${PACKAGE_NAME}"
# Copy essential deployment files
cp .env.prebuilt "${PACKAGE_NAME}/.env.prebuilt"
cp docker-compose.yml "${PACKAGE_NAME}/docker-compose.yml"
cp deploy.sh "${PACKAGE_NAME}/deploy.sh"
cp status.sh "${PACKAGE_NAME}/status.sh"
cp cleanup.sh "${PACKAGE_NAME}/cleanup.sh"
cp README.md "${PACKAGE_NAME}/README.md"
# Copy scripts directory
cp -r scripts "${PACKAGE_NAME}/scripts"
# Copy config directory
cp -r config "${PACKAGE_NAME}/config"
# Copy docs directory
cp -r docs "${PACKAGE_NAME}/docs"
# Create a quick start guide specific to this release
{
echo "# Quick Start - AzerothCore RealmMaster ${VERSION}"
echo ""
echo "## Module Profile: ${PROFILE}"
echo "${MODULE_COUNT} modules included"
echo ""
echo "## Docker Images"
echo "This release uses the following pre-built images:"
echo "- \`\${DOCKERHUB_USERNAME}/azerothcore-realmmaster:authserver-${PROFILE_TAG}-${BUILD_DATE}\`"
echo "- \`\${DOCKERHUB_USERNAME}/azerothcore-realmmaster:worldserver-${PROFILE_TAG}-${BUILD_DATE}\`"
echo ""
echo "Or use the latest tags:"
echo "- \`\${DOCKERHUB_USERNAME}/azerothcore-realmmaster:authserver-${PROFILE_TAG}-latest\`"
echo "- \`\${DOCKERHUB_USERNAME}/azerothcore-realmmaster:worldserver-${PROFILE_TAG}-latest\`"
echo ""
echo "## Installation"
echo ""
echo "1. **Edit .env.prebuilt**:"
echo " \`\`\`bash"
echo " nano .env.prebuilt"
echo " # Set: DOCKERHUB_USERNAME=your-dockerhub-username"
echo " \`\`\`"
echo ""
echo "2. **Rename to .env**:"
echo " \`\`\`bash"
echo " mv .env.prebuilt .env"
echo " \`\`\`"
echo ""
echo "3. **Deploy**:"
echo " \`\`\`bash"
echo " chmod +x deploy.sh status.sh cleanup.sh"
echo " ./deploy.sh"
echo " \`\`\`"
echo ""
echo "4. **Check status**:"
echo " \`\`\`bash"
echo " ./status.sh"
echo " \`\`\`"
echo ""
echo "## Documentation"
echo "- [Pre-Built Images Guide](docs/PREBUILT_IMAGES.md)"
echo "- [Getting Started](docs/GETTING_STARTED.md)"
echo "- [Troubleshooting](docs/TROUBLESHOOTING.md)"
echo ""
echo "## Support"
echo "- GitHub Issues: https://github.com/uprightbass360/AzerothCore-RealmMaster/issues"
echo "- AzerothCore Discord: https://discord.gg/gkt4y2x"
} > "${PACKAGE_NAME}/QUICKSTART.md"
# Make scripts executable
chmod +x "${PACKAGE_NAME}/deploy.sh"
chmod +x "${PACKAGE_NAME}/status.sh"
chmod +x "${PACKAGE_NAME}/cleanup.sh"
# Create zip archive
zip -r "${PACKAGE_NAME}.zip" "${PACKAGE_NAME}"
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV
- name: Generate release notes
run: |
{
echo "# AzerothCore RealmMaster ${VERSION} - ${PROFILE} Profile"
echo ""
echo "## 🎯 Module Profile: ${PROFILE}"
echo "${MODULE_COUNT} modules included"
echo ""
echo "## 📦 Docker Images"
echo ""
echo "Pull these pre-built images from Docker Hub:"
echo ""
echo "**Date-specific (recommended for production)**:"
echo "\`\`\`bash"
echo "docker pull \${DOCKERHUB_USERNAME}/azerothcore-realmmaster:authserver-${PROFILE_TAG}-${BUILD_DATE}"
echo "docker pull \${DOCKERHUB_USERNAME}/azerothcore-realmmaster:worldserver-${PROFILE_TAG}-${BUILD_DATE}"
echo "\`\`\`"
echo ""
echo "**Latest (auto-updated nightly)**:"
echo "\`\`\`bash"
echo "docker pull \${DOCKERHUB_USERNAME}/azerothcore-realmmaster:authserver-${PROFILE_TAG}-latest"
echo "docker pull \${DOCKERHUB_USERNAME}/azerothcore-realmmaster:worldserver-${PROFILE_TAG}-latest"
echo "\`\`\`"
echo ""
echo "## 🚀 Quick Start"
echo ""
echo "\`\`\`bash"
echo "# Download and extract"
echo "wget https://github.com/uprightbass360/AzerothCore-RealmMaster/releases/download/${VERSION}/${PACKAGE_NAME}.zip"
echo "unzip ${PACKAGE_NAME}.zip"
echo "cd ${PACKAGE_NAME}"
echo ""
echo "# Configure Docker Hub username"
echo "nano .env.prebuilt"
echo "# Set: DOCKERHUB_USERNAME=your-dockerhub-username"
echo ""
echo "# Deploy"
echo "mv .env.prebuilt .env"
echo "./deploy.sh"
echo "\`\`\`"
echo ""
echo "Full documentation in \`docs/PREBUILT_IMAGES.md\`"
echo ""
echo "## 📋 Included Modules"
echo ""
cat modules.txt
echo ""
echo "## 📊 Build Information"
echo ""
echo "- **Built**: ${BUILD_DATE}"
echo "- **AzerothCore Commit**: ${ACORE_COMMIT}"
echo "- **Source Variant**: playerbots (for MODULE_PLAYERBOTS support)"
echo "- **Profile**: ${PROFILE}"
echo "- **Module Count**: ${MODULE_COUNT}"
echo ""
echo "## 📖 Documentation"
echo ""
echo "Full documentation available in the \`docs/\` directory of the release package:"
echo "- [Pre-Built Images Guide](https://github.com/uprightbass360/AzerothCore-RealmMaster/blob/${VERSION}/docs/PREBUILT_IMAGES.md)"
echo "- [Getting Started Guide](https://github.com/uprightbass360/AzerothCore-RealmMaster/blob/${VERSION}/docs/GETTING_STARTED.md)"
echo "- [Module Catalog](https://github.com/uprightbass360/AzerothCore-RealmMaster/blob/${VERSION}/docs/MODULES.md)"
echo "- [Troubleshooting](https://github.com/uprightbass360/AzerothCore-RealmMaster/blob/${VERSION}/docs/TROUBLESHOOTING.md)"
echo ""
echo "## 🐛 Known Issues"
echo ""
echo "None at this time. Report issues at: https://github.com/uprightbass360/AzerothCore-RealmMaster/issues"
echo ""
echo "## 💬 Support"
echo ""
echo "- **GitHub Issues**: https://github.com/uprightbass360/AzerothCore-RealmMaster/issues"
echo "- **AzerothCore Discord**: https://discord.gg/gkt4y2x"
echo "- **Documentation**: https://github.com/uprightbass360/AzerothCore-RealmMaster/tree/${VERSION}/docs"
} > release_notes.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
name: "RealmMaster ${{ env.VERSION }} - ${{ env.PROFILE }} Profile"
body_path: release_notes.md
files: |
${{ env.PACKAGE_NAME }}.zip
prerelease: ${{ github.event.inputs.prerelease }}
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release summary
run: |
echo "## Release Created Successfully! 🎉" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version**: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "**Profile**: ${{ env.PROFILE }}" >> $GITHUB_STEP_SUMMARY
echo "**Modules**: ${{ env.MODULE_COUNT }}" >> $GITHUB_STEP_SUMMARY
echo "**Package**: ${{ env.PACKAGE_NAME }}.zip" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📦 Release available at:" >> $GITHUB_STEP_SUMMARY
echo "https://github.com/${{ github.repository }}/releases/tag/${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY