46 lines
1.6 KiB
PowerShell
46 lines
1.6 KiB
PowerShell
# deploy_android.ps1
|
|
# Firebase App Distribution 用のビルド・配布スクリプト (Ponshu Room Lite)
|
|
#
|
|
# 前提:
|
|
# npm install -g firebase-tools
|
|
# firebase login
|
|
#
|
|
# 引数:
|
|
# -ReleaseNotes "アップデート内容" (省略時は "Minor update")
|
|
|
|
param (
|
|
[string]$ReleaseNotes = "Minor update"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
Write-Host "🍶 Ponshu Room Lite: Android 商用ビルド・配布を開始します" -ForegroundColor Cyan
|
|
|
|
# 1. ビルド実行 (APIキーはダミー、VPSへ接続)
|
|
Write-Host " -> ビルディング APK..." -ForegroundColor Yellow
|
|
flutter build apk --release `
|
|
--dart-define=GEMINI_API_KEY=dist-build-key `
|
|
--dart-define=AI_PROXY_URL=https://(ここにVPSのドメインを入力) `
|
|
--dart-define=USE_PROXY=true `
|
|
--obfuscate `
|
|
--split-debug-info=build\debug-info
|
|
|
|
$ApkPath = "build\app\outputs\flutter-apk\app-release.apk"
|
|
|
|
if (-Not (Test-Path $ApkPath)) {
|
|
Write-Host "❌ エラー: APKが生成されていません ($ApkPath)" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
# 2. Firebase App Distributionへアップロード
|
|
# 注意: 初回実行前に Firebase Console で App Distribution を有効にし、アプリIDを調べて以下に入れる
|
|
$FirebaseAppId = "1:XXXXXXXXXXXX:android:XXXXXXXXXXXX" # <--- TODO: 書き換える
|
|
|
|
Write-Host " -> Firebaseへアップロード中..." -ForegroundColor Yellow
|
|
firebase appdistribution:distribute $ApkPath `
|
|
--app $FirebaseAppId `
|
|
--groups "beta-testers" `
|
|
--release-notes $ReleaseNotes
|
|
|
|
Write-Host "✅ 配布完了!テスターに通知メールが送信されました。" -ForegroundColor Green
|