diff --git a/build_consumer_apks.ps1 b/build_consumer_apks.ps1 new file mode 100644 index 0000000..1b33ffe --- /dev/null +++ b/build_consumer_apks.ps1 @@ -0,0 +1,73 @@ +param([switch]$SkipRelease) + +# ============================================================================ +# Ponshu Room - Consumer APK Build Script (Maita + Eiji) +# build.gradle.kts は変更しない。applicationId は既に ponshu_room_lite 固定。 +# ============================================================================ + +$ErrorActionPreference = "Stop" + +# .env.local を読み込む +$envFile = Join-Path $PSScriptRoot ".env.local" +if (-not (Test-Path $envFile)) { Write-Error ".env.local not found"; exit 1 } +Get-Content $envFile | ForEach-Object { + $line = $_.Trim() + if ($line -and -not $line.StartsWith('#') -and $line.Contains('=')) { + $idx = $line.IndexOf('=') + $key = $line.Substring(0, $idx).Trim() + $val = $line.Substring($idx + 1).Trim() + [System.Environment]::SetEnvironmentVariable($key, $val) + } +} + +$maitaKey = $env:GEMINI_API_KEY_MAITA +$eijiKey = $env:GEMINI_API_KEY_EIJI +if (-not $maitaKey) { Write-Error "GEMINI_API_KEY_MAITA not set in .env.local"; exit 1 } +if (-not $eijiKey) { Write-Error "GEMINI_API_KEY_EIJI not set in .env.local"; exit 1 } + +# 出力ディレクトリ +$timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" +$outputDir = Join-Path $PSScriptRoot "build\apk_releases\$timestamp" +New-Item -ItemType Directory -Path $outputDir -Force | Out-Null + +Write-Host "============================================" -ForegroundColor Cyan +Write-Host " Ponshu Room - Consumer APK Build" -ForegroundColor Cyan +Write-Host "============================================" -ForegroundColor Cyan +Write-Host " Output: $outputDir" -ForegroundColor Gray +Write-Host "" + +# --- 1. Maita --- +Write-Host "[1/2] Building Maita..." -ForegroundColor Yellow +flutter build apk --release ` + --dart-define=GEMINI_API_KEY=$maitaKey ` + --dart-define=IS_BUSINESS_APP=false + +if ($LASTEXITCODE -ne 0) { Write-Error "Maita build failed"; exit 1 } + +Copy-Item "build\app\outputs\flutter-apk\app-release.apk" ` + "$outputDir\ponshu_room_consumer_maita.apk" -Force +$sz = [math]::Round((Get-Item "$outputDir\ponshu_room_consumer_maita.apk").Length / 1MB, 1) +Write-Host " OK: ponshu_room_consumer_maita.apk ($sz MB)" -ForegroundColor Green + +# --- 2. Eiji --- +Write-Host "[2/2] Building Eiji..." -ForegroundColor Yellow +flutter build apk --release ` + --dart-define=GEMINI_API_KEY=$eijiKey ` + --dart-define=IS_BUSINESS_APP=false + +if ($LASTEXITCODE -ne 0) { Write-Error "Eiji build failed"; exit 1 } + +Copy-Item "build\app\outputs\flutter-apk\app-release.apk" ` + "$outputDir\ponshu_room_consumer_eiji.apk" -Force +$sz = [math]::Round((Get-Item "$outputDir\ponshu_room_consumer_eiji.apk").Length / 1MB, 1) +Write-Host " OK: ponshu_room_consumer_eiji.apk ($sz MB)" -ForegroundColor Green + +Write-Host "" +Write-Host " Build complete: $outputDir" -ForegroundColor Cyan + +# --- 3. Release to Gitea + Vercel --- +if (-not $SkipRelease) { + Write-Host "" + Write-Host " Releasing to Gitea..." -ForegroundColor Cyan + & "$PSScriptRoot\release_to_gitea.ps1" -ApkDir $outputDir +} diff --git a/web/download/releases.json b/web/download/releases.json index 0cc61e2..4d01d08 100644 --- a/web/download/releases.json +++ b/web/download/releases.json @@ -1,18 +1,18 @@ { "date": "2026-04-11", - "name": "Ponshu Room 1.0.28 (2026-04-11)", - "version": "v1.0.28", + "name": "Ponshu Room 1.0.29 (2026-04-11)", + "version": "v1.0.29", "apks": { "eiji": { "lite": { - "url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.28/ponshu_room_consumer_eiji.apk", + "url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.29/ponshu_room_consumer_eiji.apk", "size_mb": 89, "filename": "ponshu_room_consumer_eiji.apk" } }, "maita": { "lite": { - "url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.28/ponshu_room_consumer_maita.apk", + "url": "https://posimai-lab.tail72e846.ts.net/mai/ponshu-room-lite/releases/download/v1.0.29/ponshu_room_consumer_maita.apk", "size_mb": 89, "filename": "ponshu_room_consumer_maita.apk" }