'use client' /** * Build Pipeline Wizard * * Interactive guide for learning about the multi-platform * build and deployment process for Breakpilot Drive */ import { useState } from 'react' import Link from 'next/link' import AdminLayout from '@/components/admin/AdminLayout' // ======================================== // Types // ======================================== type WizardStep = | 'welcome' | 'platforms' | 'github-actions' | 'webgl-build' | 'ios-build' | 'android-build' | 'deployment' | 'version-sync' | 'summary' interface StepInfo { id: WizardStep title: string description: string } // ======================================== // Step Configuration // ======================================== const STEPS: StepInfo[] = [ { id: 'welcome', title: 'Willkommen', description: 'Build Pipeline Uebersicht' }, { id: 'platforms', title: 'Plattformen', description: 'WebGL, iOS, Android' }, { id: 'github-actions', title: 'GitHub Actions', description: 'CI/CD Workflow' }, { id: 'webgl-build', title: 'WebGL', description: 'Browser Build' }, { id: 'ios-build', title: 'iOS', description: 'App Store Build' }, { id: 'android-build', title: 'Android', description: 'Play Store Build' }, { id: 'deployment', title: 'Deployment', description: 'Store Upload' }, { id: 'version-sync', title: 'Versioning', description: 'Version Management' }, { id: 'summary', title: 'Zusammenfassung', description: 'Naechste Schritte' }, ] // ======================================== // Educational Content // ======================================== const EDUCATION_CONTENT: Record = { 'welcome': { title: 'Multi-Platform Build Pipeline', content: `Breakpilot Drive wird fuer drei Plattformen gebaut: **WebGL** - Browser-basiert, in Admin Panel eingebettet **iOS** - iPhone/iPad via App Store **Android** - Smartphones/Tablets via Google Play Die Build-Pipeline nutzt **GitHub Actions** mit **game-ci/unity-builder** fuer automatisierte, reproduzierbare Builds.`, tips: [ 'WebGL ist die primaere Plattform fuer schnelles Testing', 'Mobile Builds nur bei Tags (Releases)', 'Alle Builds werden als Artifacts gespeichert' ] }, 'platforms': { title: 'Unterstuetzte Plattformen', content: `Jede Plattform hat spezifische Anforderungen: **WebGL (HTML5/WASM)** - Brotli-Kompression - 512MB Memory - Kein Threading (Browser-Limitation) **iOS (iPhone/iPad)** - Min. iOS 14.0 - ARM64 Architektur - App Store Distribution **Android** - Min. Android 7.0 (API 24) - Target: Android 14 (API 34) - ARM64, AAB fuer Play Store`, tips: [ 'WebGL laeuft in allen modernen Browsern', 'iOS erfordert Apple Developer Account ($99/Jahr)', 'Android AAB ist Pflicht fuer Play Store' ] }, 'github-actions': { title: 'GitHub Actions Workflow', content: `Der CI/CD Workflow ist in Jobs aufgeteilt: **1. version** - Ermittelt Version aus Git Tag **2. build-webgl** - Baut Browser-Version **3. build-ios** - Baut Xcode Projekt **4. build-ios-ipa** - Erstellt signierte IPA **5. build-android** - Baut AAB/APK **6. deploy-webgl** - Deployed zu CDN **7. upload-ios** - Laedt zu App Store Connect **8. upload-android** - Laedt zu Google Play Trigger: - **Tags (v*)**: Alle Plattformen + Upload - **Push main**: Nur WebGL - **Manual**: Auswahlbar`, tips: [ 'Unity License muss als Secret hinterlegt sein', 'Signing-Zertifikate als Base64 Secrets', 'Cache beschleunigt Builds erheblich' ] }, 'webgl-build': { title: 'WebGL Build', content: `WebGL ist die schnellste Build-Variante: **Build-Einstellungen:** - Kompression: Brotli (beste Kompression) - Memory: 512MB (ausreichend fuer Spiel) - Exceptions: Nur explizite (Performance) - Linker: WASM (WebAssembly) **Output:** - index.html - Build/*.wasm.br (komprimiert) - Build/*.data.br (Assets) - Build/*.js (Loader) **Deployment:** - S3 + CloudFront CDN - Cache: 1 Jahr fuer Assets, 1h fuer HTML`, tips: [ 'Brotli-Kompression spart ~70% Bandbreite', 'Erste Ladung ~10-15MB, danach gecached', 'Server muss Brotli-Headers unterstuetzen' ] }, 'ios-build': { title: 'iOS Build', content: `iOS Build erfolgt in zwei Schritten: **Schritt 1: Unity Build** - Erstellt Xcode Projekt - Setzt iOS-spezifische Einstellungen - Output: Unity-iPhone.xcodeproj **Schritt 2: Xcode Build** - Importiert Signing-Zertifikate - Archiviert Projekt - Exportiert signierte IPA **Voraussetzungen:** - Apple Developer Account - Distribution Certificate (.p12) - Provisioning Profile - App Store Connect API Key`, tips: [ 'Zertifikate alle 1 Jahr erneuern', 'Provisioning Profile fuer jede App ID', 'TestFlight fuer Beta-Tests nutzen' ] }, 'android-build': { title: 'Android Build', content: `Android Build erzeugt AAB oder APK: **AAB (App Bundle)** - Fuer Play Store - Google optimiert fuer jedes Geraet - Kleinere Downloads - Pflicht seit 2021 **APK** - Fuer direkten Download - Debug-Builds fuer Testing - Sideloading moeglich **Signing:** - Keystore (.jks/.keystore) - Key Alias und Passwoerter - Play App Signing empfohlen **Voraussetzungen:** - Google Play Console Account ($25 einmalig) - Keystore fuer App-Signatur`, tips: [ 'Keystore NIEMALS verlieren (keine Veroeffentlichung mehr)', 'Play App Signing: Google verwaltet Upload-Key', 'Internal Testing fuer schnelle Tests' ] }, 'deployment': { title: 'Store Deployment', content: `Automatisches Deployment zu den Stores: **WebGL -> CDN (S3/CloudFront)** - Sync zu S3 Bucket - CloudFront Invalidation - Versionierte URLs **iOS -> App Store Connect** - Upload via altool - API Key Authentifizierung - TestFlight Auto-Distribution **Android -> Google Play** - Upload via r0adkll/upload-google-play - Service Account Auth - Internal Track zuerst`, tips: [ 'WebGL ist sofort live nach Deploy', 'iOS: Review dauert 1-3 Tage', 'Android: Review dauert wenige Stunden' ] }, 'version-sync': { title: 'Version Synchronisation', content: `Versionen werden zentral verwaltet: **version.json** (Runtime) - version: Semantische Version - build_number: Inkrementell - platform: Build-Target - commit_hash: Git SHA - min_api_version: API Kompatibilitaet **VersionManager.cs** (Unity) - Laedt version.json zur Laufzeit - Prueft API-Kompatibilitaet - Zeigt Update-Hinweise **Git Tags** - v1.0.0 -> Version 1.0.0 - Trigger fuer Release-Builds`, tips: [ 'build_number aus GitHub Run Number', 'min_api_version fuer erzwungene Updates', 'Semantic Versioning: MAJOR.MINOR.PATCH' ] }, 'summary': { title: 'Zusammenfassung & Naechste Schritte', content: `Du hast gelernt: ✓ Build-Targets: WebGL, iOS, Android ✓ GitHub Actions Workflow ✓ Platform-spezifische Einstellungen ✓ Store Deployment Prozess ✓ Version Management **Naechste Schritte:** 1. GitHub Secrets konfigurieren 2. Apple/Google Developer Accounts einrichten 3. Keystore und Zertifikate erstellen 4. Ersten Release-Tag erstellen`, tips: [ 'Dokumentation in BreakpilotDrive/ci/', 'BuildScript.cs fuer lokale Builds', 'version.json wird automatisch aktualisiert' ] }, } // ======================================== // Components // ======================================== function WizardStepper({ steps, currentStep, onStepClick }: { steps: StepInfo[] currentStep: WizardStep onStepClick: (step: WizardStep) => void }) { const currentIndex = steps.findIndex(s => s.id === currentStep) return (
{steps.map((step, index) => { const isActive = step.id === currentStep const isCompleted = index < currentIndex const isClickable = index <= currentIndex + 1 return ( ) })}
) } function EducationCard({ title, content, tips }: { title: string; content: string; tips: string[] }) { return (

{title}

{content.split('\n\n').map((paragraph, i) => (

{paragraph.split('**').map((part, j) => j % 2 === 1 ? {part} : part )}

))}

Tipps:

    {tips.map((tip, i) => (
  • {tip}
  • ))}
) } function PlatformCards() { const platforms = [ { name: 'WebGL', icon: '🌐', status: 'Aktiv', size: '~15 MB', features: ['Browser-basiert', 'Sofort spielbar', 'Admin Panel Embed'] }, { name: 'iOS', icon: '📱', status: 'Bereit', size: '~80 MB', features: ['iPhone & iPad', 'App Store', 'Push Notifications'] }, { name: 'Android', icon: '🤖', status: 'Bereit', size: '~60 MB', features: ['Play Store', 'AAB Format', 'Wide Device Support'] }, ] return (
{platforms.map((platform) => (
{platform.icon}

{platform.name}

{platform.size}

{platform.status}
    {platform.features.map((feature, i) => (
  • {feature}
  • ))}
))}
) } function WorkflowDiagram() { const jobs = [ { name: 'version', icon: '🏷️', runner: 'ubuntu' }, { name: 'build-webgl', icon: '🌐', runner: 'ubuntu' }, { name: 'build-ios', icon: '📱', runner: 'macos' }, { name: 'build-android', icon: '🤖', runner: 'ubuntu' }, { name: 'deploy', icon: '🚀', runner: 'ubuntu' }, ] return (

Workflow Jobs

{jobs.map((job, i) => (
{job.icon}

{job.name}

{job.runner}

{i < jobs.length - 1 && ( )}
))}
) } function SecretsChecklist() { const secrets = [ { name: 'UNITY_LICENSE', desc: 'Unity Personal/Pro License', required: true }, { name: 'UNITY_EMAIL', desc: 'Unity Account Email', required: true }, { name: 'UNITY_PASSWORD', desc: 'Unity Account Password', required: true }, { name: 'IOS_BUILD_CERTIFICATE_BASE64', desc: 'Apple Distribution Certificate', required: false }, { name: 'IOS_PROVISION_PROFILE_BASE64', desc: 'iOS Provisioning Profile', required: false }, { name: 'ANDROID_KEYSTORE_BASE64', desc: 'Android Signing Keystore', required: false }, { name: 'AWS_ACCESS_KEY_ID', desc: 'AWS fuer S3/CloudFront', required: false }, ] return (

GitHub Secrets Checkliste

) } // ======================================== // Main Component // ======================================== export default function BuildPipelineWizardPage() { const [currentStep, setCurrentStep] = useState('welcome') const currentStepIndex = STEPS.findIndex(s => s.id === currentStep) const education = EDUCATION_CONTENT[currentStep] const goToNext = () => { const nextIndex = currentStepIndex + 1 if (nextIndex < STEPS.length) { setCurrentStep(STEPS[nextIndex].id) } } const goToPrevious = () => { const prevIndex = currentStepIndex - 1 if (prevIndex >= 0) { setCurrentStep(STEPS[prevIndex].id) } } return ( {/* Back Link */}
Zurueck zum Game Dashboard
{/* Stepper */}
{/* Content */}
{/* Main Content */}
{/* Step-specific content */} {currentStep === 'platforms' && } {currentStep === 'github-actions' && } {currentStep === 'deployment' && } {/* Navigation */}
{/* Sidebar */}
{/* Progress */}

Fortschritt

Schritt {currentStepIndex + 1} von {STEPS.length} {Math.round(((currentStepIndex + 1) / STEPS.length) * 100)}%
{/* Pipeline Overview */}

Pipeline Flow

Git Push/Tag
GitHub Actions
Unity Build
Deploy / Upload
{/* Quick Links */}

Wichtige Dateien

  • YAML: ci/build-all-platforms.yml
  • C#: Assets/Editor/BuildScript.cs
  • JSON: Assets/Resources/version.json
  • Plist: ci/ios-export-options.plist
) }