|
| 1 | +name: Generate and Release Documentation |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Release version (e.g., v1.0.0, v2.1.0)' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + prerelease: |
| 11 | + description: 'Mark as pre-release' |
| 12 | + required: false |
| 13 | + default: false |
| 14 | + type: boolean |
| 15 | + |
| 16 | +jobs: |
| 17 | + generate-and-release: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout repository |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Setup Node.js |
| 25 | + uses: actions/setup-node@v4 |
| 26 | + with: |
| 27 | + node-version: '20' |
| 28 | + cache: 'npm' |
| 29 | + cache-dependency-path: site/package-lock.json |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + cd site |
| 34 | + npm ci |
| 35 | +
|
| 36 | + - name: Install Puppeteer dependencies |
| 37 | + run: | |
| 38 | + sudo apt-get update |
| 39 | + sudo apt-get install -y \ |
| 40 | + ca-certificates \ |
| 41 | + fonts-liberation \ |
| 42 | + libappindicator3-1 \ |
| 43 | + libasound2 \ |
| 44 | + libatk-bridge2.0-0 \ |
| 45 | + libatk1.0-0 \ |
| 46 | + libc6 \ |
| 47 | + libcairo2 \ |
| 48 | + libcups2 \ |
| 49 | + libdbus-1-3 \ |
| 50 | + libexpat1 \ |
| 51 | + libfontconfig1 \ |
| 52 | + libgbm1 \ |
| 53 | + libgcc1 \ |
| 54 | + libglib2.0-0 \ |
| 55 | + libgtk-3-0 \ |
| 56 | + libnspr4 \ |
| 57 | + libnss3 \ |
| 58 | + libpango-1.0-0 \ |
| 59 | + libpangocairo-1.0-0 \ |
| 60 | + libstdc++6 \ |
| 61 | + libx11-6 \ |
| 62 | + libx11-xcb1 \ |
| 63 | + libxcb1 \ |
| 64 | + libxcomposite1 \ |
| 65 | + libxcursor1 \ |
| 66 | + libxdamage1 \ |
| 67 | + libxext6 \ |
| 68 | + libxfixes3 \ |
| 69 | + libxi6 \ |
| 70 | + libxrandr2 \ |
| 71 | + libxrender1 \ |
| 72 | + libxss1 \ |
| 73 | + libxtst6 \ |
| 74 | + lsb-release \ |
| 75 | + wget \ |
| 76 | + xdg-utils |
| 77 | +
|
| 78 | + - name: Generate documentation |
| 79 | + run: | |
| 80 | + cd site |
| 81 | + node crawl-github-pages.js |
| 82 | +
|
| 83 | + - name: Validate documentation generation |
| 84 | + run: | |
| 85 | + cd site/generated-docs |
| 86 | + echo "📊 Generated files:" |
| 87 | + ls -la |
| 88 | + echo "" |
| 89 | + echo "📋 File count: $(ls -1 *.md | wc -l)" |
| 90 | + echo "📏 Total size: $(du -sh . | cut -f1)" |
| 91 | +
|
| 92 | + # Verify required files exist |
| 93 | + if [ ! -f "README.md" ]; then |
| 94 | + echo "❌ README.md not found!" |
| 95 | + exit 1 |
| 96 | + fi |
| 97 | +
|
| 98 | + if [ ! -f "index.md" ]; then |
| 99 | + echo "❌ index.md not found!" |
| 100 | + exit 1 |
| 101 | + fi |
| 102 | +
|
| 103 | + if [ ! -f "magic.md" ]; then |
| 104 | + echo "❌ magic.md not found!" |
| 105 | + exit 1 |
| 106 | + fi |
| 107 | +
|
| 108 | + echo "✅ Documentation validation passed!" |
| 109 | +
|
| 110 | + - name: Create release archive |
| 111 | + run: | |
| 112 | + cd site/generated-docs |
| 113 | +
|
| 114 | + # Create metadata file |
| 115 | + cat > RELEASE_INFO.md << EOF |
| 116 | + # Aetheria World Reference - Release ${{ github.event.inputs.version }} |
| 117 | +
|
| 118 | + **Generated:** $(date -u '+%Y-%m-%d %H:%M:%S UTC') |
| 119 | + **Source Commit:** ${{ github.sha }} |
| 120 | + **GitHub Pages Source:** https://rjordan.github.io/Aetheria |
| 121 | + **Repository:** https://github.com/${{ github.repository }} |
| 122 | +
|
| 123 | + ## Contents |
| 124 | +
|
| 125 | + This archive contains the complete Aetheria world reference documentation as individual markdown files: |
| 126 | +
|
| 127 | + - **README.md** - Master index and usage instructions |
| 128 | + - **Main sections** - Core world information (classes, magic, equipment, etc.) |
| 129 | + - **Subsections** - Detailed pages (magic schools, specific topics) |
| 130 | +
|
| 131 | + ## Usage |
| 132 | +
|
| 133 | + 1. Extract the archive |
| 134 | + 2. Start with \`README.md\` for the complete index |
| 135 | + 3. Load individual files into your AI model as needed |
| 136 | + 4. Use the navigation links to move between related sections |
| 137 | +
|
| 138 | + ## File Structure |
| 139 | +
|
| 140 | + \`\`\` |
| 141 | + $(ls -la *.md | awk '{print $9, "(" $5 " bytes)"}' | sort) |
| 142 | + \`\`\` |
| 143 | +
|
| 144 | + ## Total Statistics |
| 145 | +
|
| 146 | + - **Files:** $(ls -1 *.md | wc -l) markdown documents |
| 147 | + - **Size:** $(du -sh . | cut -f1) uncompressed |
| 148 | + - **Words:** ~$(cat *.md | wc -w) total words |
| 149 | +
|
| 150 | + For the latest version, visit: https://github.com/${{ github.repository }}/releases |
| 151 | + EOF |
| 152 | +
|
| 153 | + # Create the release archive |
| 154 | + zip -r "aetheria-docs-${{ github.event.inputs.version }}.zip" *.md RELEASE_INFO.md |
| 155 | +
|
| 156 | + echo "📦 Created release archive:" |
| 157 | + ls -lh *.zip |
| 158 | +
|
| 159 | + - name: Create release |
| 160 | + uses: softprops/action-gh-release@v1 |
| 161 | + with: |
| 162 | + tag_name: ${{ github.event.inputs.version }} |
| 163 | + name: "Aetheria Documentation ${{ github.event.inputs.version }}" |
| 164 | + body: | |
| 165 | + # Aetheria World Reference Documentation |
| 166 | +
|
| 167 | + Complete modular documentation for the Aetheria fantasy world, automatically generated from the live GitHub Pages site. |
| 168 | +
|
| 169 | + ## What's Included |
| 170 | +
|
| 171 | + 📋 **${{ steps.count-files.outputs.count }} Markdown Files** - Individual pages for each section |
| 172 | + 🔗 **Cross-Linked Navigation** - Easy movement between related topics |
| 173 | + 📖 **Master Index** - Complete overview and usage instructions |
| 174 | + 🤖 **AI-Optimized** - Perfect for loading into AI model contexts |
| 175 | +
|
| 176 | + ## Quick Start |
| 177 | +
|
| 178 | + 1. Download the `aetheria-docs-${{ github.event.inputs.version }}.zip` file below |
| 179 | + 2. Extract and start with `README.md` for the complete index |
| 180 | + 3. Load individual sections into your AI model as needed |
| 181 | +
|
| 182 | + ## File Highlights |
| 183 | +
|
| 184 | + - **README.md** - Master index and usage guide |
| 185 | + - **magic.md** + **magic-*.md** - Complete magic system with all schools |
| 186 | + - **classes.md** - All character classes and abilities |
| 187 | + - **politics.md** - Organizations and factions |
| 188 | + - **religion.md** - Gods, beliefs, and spiritual practices |
| 189 | +
|
| 190 | + ## Generated From |
| 191 | +
|
| 192 | + - **Source:** https://rjordan.github.io/Aetheria |
| 193 | + - **Commit:** ${{ github.sha }} |
| 194 | + - **Generated:** $(date -u '+%Y-%m-%d %H:%M:%S UTC') |
| 195 | +
|
| 196 | + Perfect for AI storytelling, world-building, and RPG reference! |
| 197 | + files: | |
| 198 | + site/generated-docs/aetheria-docs-${{ github.event.inputs.version }}.zip |
| 199 | + prerelease: ${{ github.event.inputs.prerelease }} |
| 200 | + draft: false |
| 201 | + env: |
| 202 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 203 | + |
| 204 | + - name: Summary |
| 205 | + run: | |
| 206 | + echo "🎉 Release ${{ github.event.inputs.version }} created successfully!" |
| 207 | + echo "📁 Archive: aetheria-docs-${{ github.event.inputs.version }}.zip" |
| 208 | + echo "🔗 View release: https://github.com/${{ github.repository }}/releases/tag/${{ github.event.inputs.version }}" |
0 commit comments