Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DroidKaigi 2021 - A Practical Guide to Building Mobile App Distribution Workflows

DroidKaigi 2021 - A Practical Guide to Building Mobile App Distribution Workflows

DroidKaigi 2021 Day2 で発表したアプリ配信フローを構築するための話です。

https://droidkaigi.jp/2021/timetable/276963/?day=2
https://github.com/jmatsu/droidkaigi2021-appendix
https://www.youtube.com/watch?v=DA2ziL4qgZk

Matsuda Jumpei

October 20, 2021
Tweet

More Decks by Matsuda Jumpei

Other Decks in Programming

Transcript

  1. アプリ配信ワークフローの概念図 テスター 配信環境 e.g. CI/CD サービス ビルド環境 e.g. アプリ配信サービス タイミングは?

    何を? 何をしたい? いつ? 誰に? どうして? 1/4 アプリ配信ワークフローとよくある問題点
  2. B - 何を配信するのか 機能差を意識した種別 プラットフォーム別 (AndroidOS, AndroidTV, WatchWearOS, FireOS etc.)

    Variant (本番相当のビルド、QAツール入り、デバッグビルド etc.) 安定度や時間を意識した種別 マイルストーン (開発中のバージョン、プレリリースバージョン etc.) 2/4 アプリ配信機構の理解を深める - 01 最低限の検討項目
  3. D - どうやって配信するのか 物理アクセス ADB (USB ケーブル、同ネットワーク上での over tcp) ストレージ

    (USB flash storage etc.) ファイルシェア (Android Beam, NearBy Share, Files by Google etc.) インターネット経由の Over the Air アプリ配信サービス (Firebase App Distribution, DeployGate, Bitrise etc.) 共有ストレージ (Google Drive, S3, Cloud Storage, GitHub Releases etc.) 2/4 アプリ配信機構の理解を深める - 01 最低限の検討項目
  4. 管理対象ごとに分け、かつ分けられる方法を選ぶ 2/4 アプリ配信機構の理解を深める - 02 保守運用に関する責務の所在 アプリ開発者が担当するべき管理対象 配信アプリの管理 目的に応じた適切な Variant

    などの選択 配信の準備タイミングの管理 目的から適切なタイミングを選定・維持 配信対象側が担当するべき管理対象 配信対象のグループ管理 QAチームの管理はQAチーム内部の人間が、公募やお触り会は PdM が
  5. 業務・目的の代表例 2/4 アプリ配信機構の理解を深める - 04 複数の事例とその目的を知る コードレビュー プロトタイプお触り会 リリース前QA ドッグフーディング

    いつ 都度(高頻度) やや突発的 計画的(リリーススケ ジュールに準拠) 自由(いつでも) 何を 開発中のブランチ 上の成果物 特定の機能を含んだ版 プレリリース版 過去のQA済み版(本番) QA済みRC版 誰に 開発者 (特にレビュワー) チーム関係者 QA担当者 チーム関係者 全社内関係者 どうやって 開発者が用意、ま たはCI/CDによる自 動化 e.g. 配信サービス や共有ストレージ 開発者が用意する e.g. 配信サービスや共 有ストレージ、物理アク セスも可 配信サービスを経由し、 自発的に取得またはリ アルタイム通知にて受 け取る 配信対象者が自発的 に取得出来る e.g. 配信サービスや共 有ストレージ
  6. 業務・目的の代表例 (時間の都合で資料のみ) Hot Fix デザインレビュー 営業デモ Open/Closed テスト いつ 突発的

    計画的 or 突発的(チー ムに依存) 突発的 計画的 or 突発的(チー ムに依存) 何を 修正ブランチ上の 成果物 RC版(QA済みかは業務 フローに依存) QA済みRC版 プロトタイプ版 QA済みRC版 誰に 開発者 (特にレビュワー) チームのデザイナー 社内非開発者 公募テスター 社内テスター どうやって 開発者が用意、ま たは自動化による e.g. CI/CD デザイナーが自発的に 取得出来る or 開発者が 用意する e.g. 配信サービスや共 有ストレージ 配信サービスを経由 し、自発的に取得また はリアルタイム通知に て受け取る 開発者(または企画者)が 配信サービスを利用して 配布する 2/4 アプリ配信機構の理解を深める - 04 複数の事例とその目的を知る
  7. on: pull_request: types: [labeled, ... ] jobs: assemble-and-distribute-app-to-review: if: >

    github.event.action != 'labeled' || github.event.label.name == 'instant-deployment' steps: - // checkout the code and build an aab - id: upload uses: jmatsu/[email protected] with: // several required params are omitted due to no space. message: | Ran ./gradlew assembleDebug on ${{ github.ref }} / ${{ github.sha }} Built by GitHub Actions for code-review distribution_find_by: name distribution_id: "codereview/${{ github.ref }}" - // comment ${{ steps.upload.outputs.distribution_url }} to the pr 特定ラベル付与 or それ以外のPRイベントで発火 Rev., Variant, 目的 を明示的に付与 branch 名ごとに固有の URLを発行させる DeployGate + GitHub Actions での実装例 3/4 実践 Showcases - 実装例の紹介 - A コードレビュー
  8. on: pull_request jobs: assemble-and-distribute-prototype: if: > contains(github.event.pull_request.head.ref, 'prototype') && contains(github.event.pull_request.labels.*.name,

    'continuous-deployment') steps: - ... // build an apk or aab - uses: wzieba/Firebase-Distribution-Github-Action@v1 with: appId: ... // app id token: ... // auth token via secrets (or use service account) groups: ${{ github.event.pull_request.head.ref }} // == 20211020-droidkaigi-day2-prototype file: ... // app path releaseNotes: | Ran ./gradlew assembleDebug on ${{ github.ref }} / ${{ github.sha }} Built by GitHub Actions for prototype behavior check branch名の規則性 + 特定ラベルがついている branch 名を 配信グループ名と 一致させる Rev., Variant, 目的を 明示的に表現 Firebase App Distribution + GitHub Actions での実装例 3/4 実践 Showcases - 実装例の紹介 - B プロトタイプお触り会
  9. CI ざっくりとしたイメージ and more プレリリースの発行 3/4 実践 Showcases - 実装例の紹介

    - C リリース前QA タグやマージ デグレなどを考慮し、 過去の版もインストール 可能であるべき 開発者が指定した版を QA するので 配信サービスがオススメ 複数のアプリを 担当していることも。 明示的な通知が良い
  10. on: push: branches: - 'release/*' jobs: assemble-and-distribute: steps: - ...

    - id: upload uses: jmatsu/[email protected] with: message: | Ran ./gradlew bundleRelease on ${{ github.ref }} / ${{ github.sha }} ${{ github.event.head_commit.message }} Built by ${{ github.event.pusher.name }} through Actions for RC distribution distribution_find_by: name distribution_id: pre-release-qa 特定のブランチでの push Commit Message を リリースノートとして扱う QA用に固定された 共有リンクを使う DeployGate + GitHub Actions での実装例 3/4 実践 Showcases - 実装例の紹介 - C リリース前QA
  11. - id: upload uses: jmatsu/[email protected] ... - uses: slackapi/[email protected] with:

    slack-message: | <@qa_ug_id> new RC of ${{ steps.upload.outputs.package_name }} is available. `${{ github.event.head_commit.message }}` Rev. #$(cat ${{ steps.upload.outputs.response_json_path }} | jq -r '.results.revision') Install via ${{ steps.upload.outputs.distribution_url }} QA陣へ能動的に 修正内容を伝える 配信サービス上で 特定出来る情報を含める DeployGate + GitHub Actions での実装例 3/4 実践 Showcases - 実装例の紹介 - リリース前QA
  12. 欲しい成果物を特定出来るようにしておく ビルド環境のメタデータ e.g. Commit SHA1、ブランチ名 Variant を表現する文字列 トリガー(理由)を含める とりあえず詰め込む大量の git

    log 意味のない文字列 e.g. 空文字、固定文字列 (“new update” など) ✅ ✅ ✅ ❌ ❌ message: | Ran ./gradlew assembleDebug on ${{ github.ref }} / ${{ github.sha }} Built by GitHub Actions for prototype behavior check 3/4 実践 Showcases - 実装例の紹介 - D 番外編 - 今すぐ出来る改善
  13. 継続的でなくてもいいので、素早く配布出来るように on: workflow_dispatch: inputs: ref: required: true variant: required: true

    track-name: required: true jobs: assemble-and-distribute: steps: - // checkout at ${{ github.event.inputs.ref }} - id: build // setup-java, generate ${{ github.event.inputs.variant }} aab uses: ./.github/actions/bundle_aab - uses: jmatsu/[email protected] with: message: | ${{ steps.build.outputs.build-metadata }} Built by GitHub Actions for manual distribution distribution_find_by: name distribution_id: ${{ github.event.inputs.track-name }} // or - uses: wzieba/Firebase-Distribution-Github-Action@v1 with: groups: ${{ github.event.inputs.track-name }} releaseNotes: | ${{ steps.build.outputs.build-metadata }} Built by GitHub Actions for manual distribution 3/4 実践 Showcases - 実装例の紹介 - D 番外編 - 今すぐ出来る改善
  14. Appendix - DeployGate - https://deploygate.com - Firebase App Distribution -

    https://firebase.google.com/docs/app-distribution - GitHub - http://github.com/ - GitHub Actions - https://github.com/features/actions - Bitrise - https://www.bitrise.io/ - いらすとや - http://www.irasutoya.com/ - サンプル置き場 - https://github.com/jmatsu/droidkaigi2021-appendix