Skip to content

AndroidビルドワークフローにGoogle Play内部テストトラックへのAABアップロードを追加 - #6456

Merged
TinyKitten merged 1 commit into
devfrom
chore/android-play-upload
Jul 23, 2026
Merged

TinyKitten merged 1 commit into
devfrom
chore/android-play-upload

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

概要

build_android.yml がAABのビルドとArtifactアップロードで止まっており、Google Playへの提出が手作業だったため、ビルド後にGoogle Play内部テストトラックへ自動アップロードするステップを追加しました。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • ビルド成功後に r0adkll/[email protected] でAABをGoogle Playの内部テスト(internal)トラックへアップロードするステップを追加
  • R8難読化が有効なため mapping.txt も同時にアップロードし、Play Consoleでのクラッシュレポート復号に対応
  • build_vars ステップでvariantに応じたパッケージ名を出力(prodRelease → me.tinykitten.trainlcd / devRelease → me.tinykitten.trainlcd.dev)
  • workflow_dispatch に upload_to_play 入力(既定 true)を追加し、手動実行時にビルドのみの運用も可能に(push トリガーでは常にアップロード)

必要なセットアップ

  • リポジトリシークレット PLAY_SERVICE_ACCOUNT_JSON の登録が必要です(Google CloudサービスアカウントのJSONキー)。Play Console側で該当サービスアカウントを招待し、両アプリに対してテストトラックへのリリース権限を付与してください。
  • 各アプリの初回AABアップロードはPlay Consoleから手動で行っておく必要があります(API経由の初回アップロードは不可のため)。

設計判断

prodRelease もproductionトラックへの直接公開ではなくinternalトラックへのアップロードとし、ストア公開はPlay Console上でのトラック昇格で行う運用を想定しています。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

省略: アプリコードの変更なし(CIワークフローのみ)。YAML構文チェック(python3 -c "import yaml; ...")は実施済み。実際のアップロード動作はシークレット登録後の workflow_dispatch 実行での確認が必要です。

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 新機能
    • Androidビルドを手動実行する際、Google Playへのアップロード有無を選択できるようになりました。
    • ビルド成果物をGoogle Playの内部テストトラックへ自動アップロードできるようになりました。
    • 本番版と開発版で、適切なGoogle Playパッケージ名が使用されます。

@TinyKitten TinyKitten self-assigned this Jul 23, 2026
@github-actions github-actions Bot added the ci/cd label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Android ビルドワークフローに、手動実行時の Google Play アップロード制御、バリアント別パッケージ名の出力、AAB とマッピングファイルの内部トラック送信を追加しました。

Changes

Android Play Store アップロード

Layer / File(s) Summary
アップロード設定とバリアント出力
.github/workflows/build_android.yml
upload_to_play 入力を追加し、バリアント別のパッケージ名とアップロード可否を出力します。
Google Play 内部トラックへのアップロード
.github/workflows/build_android.yml
成果物アップロード後、設定が有効な場合に AAB と対応する ProGuard/R8 マッピングファイルを内部トラックへ送信します。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant GitHubActions
  participant BuildVars
  participant GooglePlay
  Developer->>GitHubActions: 手動実行と upload_to_play を指定
  GitHubActions->>BuildVars: 入力値とビルドバリアントを渡す
  BuildVars->>GitHubActions: パッケージ名とアップロード可否を出力
  GitHubActions->>GooglePlay: 有効時に AAB とマッピングファイルを内部トラックへアップロード
Loading

Poem

ぴょんと跳ねるウサギが見る
AAB が空へ舞い上がる
prod と dev を見分けて
Play の内側へ届けよう
マッピングも仲間入り
にんじん色のリリースだ!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 主変更であるAndroidビルドワークフローへのGoogle Play内部トラック用AABアップロード追加を的確に表しています。
Description check ✅ Passed 概要、変更の種類、変更内容、テストが揃っており、テンプレート要件をほぼ満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/android-play-upload

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
.github/workflows/build_android.yml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/build_android.yml (2)

183-183: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Play のサービスアカウントを扱う action を commit SHA に固定してください。

@v1.1.3 はタグ参照です。第三者 action はレビュー済みの完全な commit SHA に固定し、更新時だけ意図的に変更してください。GitHub も SHA 固定を immutable release の安全策として推奨しています。 (docs.github.com)

Based on learnings from GitHub secure-use guidance: secret を扱う第三者 action は immutable な参照を使用します。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build_android.yml at line 183, Update the third-party
action reference in the build workflow to use the reviewed full commit SHA
instead of the mutable r0adkll/upload-google-play v1.1.3 tag, preserving the
existing action and configuration.

Source: MCP tools


18-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

手動 dry-run と Play Console の前提条件を文書化してください。

upload_to_play=false を指定する手動実行が dry-run の手順になること、PLAY_SERVICE_ACCOUNT_JSON、サービスアカウント権限、初回 AAB 登録、prodRelease の master 制約を README または workflow コメントに明記してください。push 時は常にアップロードされる点も記載が必要です。

As per coding guidelines: workflow 更新では dry-run 手順、前提条件、secret、環境変数、サービスアカウントを文書化します。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build_android.yml around lines 18 - 22, Document the
Android workflow prerequisites and usage near upload_to_play: explain that
manual runs with upload_to_play=false are the dry-run procedure, while
push-triggered runs always upload; also document PLAY_SERVICE_ACCOUNT_JSON,
required service-account permissions, initial AAB registration, and the
prodRelease master-branch restriction.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build_android.yml:
- Around line 181-190: Update the Android build workflow around the Google Play
upload step and its preceding Gradle build configuration so each push injects a
package-specific, monotonically increasing versionCode instead of relying on the
fixed dev/prod value 100000542. Ensure both flavors receive the generated
versionCode during the build, and preserve the upload’s packageName and release
artifact flow.

---

Nitpick comments:
In @.github/workflows/build_android.yml:
- Line 183: Update the third-party action reference in the build workflow to use
the reviewed full commit SHA instead of the mutable r0adkll/upload-google-play
v1.1.3 tag, preserving the existing action and configuration.
- Around line 18-22: Document the Android workflow prerequisites and usage near
upload_to_play: explain that manual runs with upload_to_play=false are the
dry-run procedure, while push-triggered runs always upload; also document
PLAY_SERVICE_ACCOUNT_JSON, required service-account permissions, initial AAB
registration, and the prodRelease master-branch restriction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2b9f8cc-8328-4bc4-b6f9-6677014f94e5

📥 Commits

Reviewing files that changed from the base of the PR and between 2699b9a and 63a9efe.

📒 Files selected for processing (1)
  • .github/workflows/build_android.yml

Comment thread .github/workflows/build_android.yml Resolved
@TinyKitten
TinyKitten merged commit 946513e into dev Jul 23, 2026
4 checks passed
@TinyKitten
TinyKitten deleted the chore/android-play-upload branch July 23, 2026 01:29
@TinyKitten TinyKitten mentioned this pull request Jul 23, 2026
6 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant