Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ZOZOTOWNの開発で試したUIの確認/検証の効率化 / Efficiency of UI ...
Search
Ryosuke Horie
October 21, 2020
Programming
650
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ZOZOTOWNの開発で試したUIの確認/検証の効率化 / Efficiency of UI checks/verifications tried in the development of ZOZOTOWN Apps
Sample Repository
https://github.com/horie1024/github_actions_android_sample
Ryosuke Horie
October 21, 2020
More Decks by Ryosuke Horie
See All by Ryosuke Horie
Androidifyから学ぶFirebase AI Logic SDKの使い方
horie1024
0
98
GitHub Copilot Use Cases at ZOZO
horie1024
1
3.6k
Miro × ZOZO ZOZOのMiro活用事例紹介
horie1024
0
3.2k
GitHub Copilotは開発者の生産性をどれだけ上げるのか?ZOZOでの全社導入とその効果 / How Much Does GitHub Copilot Improve Developer Productivity? The Company-wide Implementation and Its Effects at ZOZO
horie1024
36
31k
ZOZOTOWNにおける開発生産性向上に関する取り組み / Initiatives to Improve Development Productivity at ZOZOTOWN
horie1024
8
6.8k
How does the Relay connect Android app development and Design?
horie1024
2
2.3k
既存画面の Jetpack Composeでの書き換え: FAANSでの事例紹介 / Case study of rewriting existing screens with Jetpack Compose
horie1024
0
2.1k
スキルマップを作った話 / Create a skills map
horie1024
3
4.9k
Miroを使った開発効率向上のための取り組み / Using Miro Efforts to Improve Development Efficiency
horie1024
0
2.8k
Other Decks in Programming
See All in Programming
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
170
AHC070解法紹介
eijirou
0
150
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.6k
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
570
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
170
The Rails Doctrine Decade
koic
2
460
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Java 27新機能 / Java 27 new features
kishida
2
190
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
610
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
850
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
290
Odyssey Design
rkendrick25
PRO
2
850
The Language of Interfaces
destraynor
162
27k
Navigating Weather and Climate Data
rabernat
0
540
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
300
Google's AI Overviews - The New Search
badams
0
1.6k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Claude Code のすすめ
schroneko
67
230k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
Transcript
ZOZOTOWNの開発で試した UIの確認/検証の効率化 2020/10/21(Wed) Chatwork Tech Talk #1 株式会社ZOZOテクノロジーズ ZOZOTOWN部
Androidチーム Tech Lead 堀江 亮介 Copyright © ZOZO Technologies, Inc.
© ZOZO Technologies, Inc. 株式会社ZOZOテクノロジーズ ZOZOTOWN部 Androidチーム Tech Lead 堀江
亮介 • 自動化とビールが好き • @Horie1024 • 昔Androidテスト全書という本を書きました 2
© ZOZO Technologies, Inc. 開発中のUIの確認/検証をどう行っていますか? 3
© ZOZO Technologies, Inc. 4 1. 開発 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 ZOZOTOWN Androidの場合
© ZOZO Technologies, Inc. 5 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 もし問題があれば・・ 問題の把握と修正から再開
© ZOZO Technologies, Inc. 6 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 もし問題があれば・・ 問題の把握と修正から再開 問題の修正から完了までのフローを効率化したい
© ZOZO Technologies, Inc. 7 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 効率化するポイントを探す
© ZOZO Technologies, Inc. 8 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 効率化するポイントを探す 手動でAPKのビルドと配布を行っていた
© ZOZO Technologies, Inc. 9 APKのビルド Googleドライブへの アップロード デザイナーへリンクを共有 確認/検証用アプリの用意と配布の自動化
© ZOZO Technologies, Inc. 10 APKのビルド Googleドライブへの アップロード デザイナーへリンクを共有 確認/検証用アプリの用意と配布の自動化
この部分を自動化する
© ZOZO Technologies, Inc. 11 APKのビルド Googleドライブへの アップロード デザイナーへリンクを共有 確認/検証用アプリの用意と配布の自動化
CIサーバー + アプリ配布サービス で容易に自動化
© ZOZO Technologies, Inc. 12 APKのビルド Googleドライブへの アップロード デザイナーへリンクを共有 確認/検証用アプリの用意と配布の自動化
GitHub Actions DeployGate GitHub Actions + DeployGate で実現
© ZOZO Technologies, Inc. 13 確認/検証用アプリの用意と配布の自動化 • デザイナーへの共有にはDeployGateの配布ページを利用 •
2次元バーコードの読み取りでインストールできるので簡単 • 簡単なのがとても重要
© ZOZO Technologies, Inc. 14 確認/検証用アプリの用意と配布の自動化 • デザイナーへの共有にはDeployGateの配布ページを利用 •
2次元バーコードの読み取りでインストールできるので簡単 • 簡単なのがとても重要 複雑・煩雑だと使われなくなってしまう
© ZOZO Technologies, Inc. 15 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 確認/検証用アプリの用意と配布の自動化 GitHub Actions + DeployGateで自動化
© ZOZO Technologies, Inc. 16 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 確認/検証用アプリの用意と配布の自動化 GitHub Actions + DeployGateで自動化 GitHub Actionsのビルドトリガーをどこに置くか?
© ZOZO Technologies, Inc. 17 GitHub Actionsのビルドトリガー 何らかのイベント
© ZOZO Technologies, Inc. 18 GitHub Actionsのビルドトリガー 何らかのイベント GitHub上で発生するイベントと相性が良い
© ZOZO Technologies, Inc. GitHub上で発生するイベント = 開発で発生するイベント 19
© ZOZO Technologies, Inc. 20 1. 問題の把握と修正 2. 確認/検証用アプリの用意と配布 3.
デザイナーへ確認/検証の依頼 4. 問題があれば修正、なければ完了 確認/検証用アプリの用意と配布の自動化 開発で行っている作業(GitHubを使用する作業)を書き出す
© ZOZO Technologies, Inc. 21 1. 問題の把握と修正 2. Pull Requestのオープン
3. 確認/検証用アプリの用意と配布 4. デザイナーへ確認/検証の依頼 5. 問題があれば修正、なければ完了 6. Pull Requestのクローズ 確認/検証用アプリの用意と配布の自動化
© ZOZO Technologies, Inc. 22 1. 問題の把握と修正 2. Pull Requestのオープン
3. 確認/検証用アプリの用意と配布 4. デザイナーへ確認/検証の依頼 5. 問題があれば修正、なければ完了 6. Pull Requestのクローズ 確認/検証用アプリの用意と配布の自動化
© ZOZO Technologies, Inc. 23 • 配布のライフサイクル ◦ Pull Requestのオープン
→ APKをビルドし配布開始 ◦ Pull Requestのクローズ → APKの配布終了 確認/検証用アプリの用意と配布の自動化
© ZOZO Technologies, Inc. 24 1. 問題の把握と修正 2. Pull Requestのオープン
→ APKのビルドと配布ページ作成 3. デザイナーへ確認/検証の依頼 → 配布ページのURLを共有 4. 問題があれば修正、なければ完了 5. Pull Requestのクローズ → 配布ページ削除 実現したいUIの確認/検証フロー これを実現するようGitHub ActionsのWorkflowを組む
© ZOZO Technologies, Inc. デモ サンプルプロジェクトで実際にPull Requestを作成し、 配布ページが自動で作られる様子を紹介します。 25
© ZOZO Technologies, Inc. GitHub Actionsの設定 26
© ZOZO Technologies, Inc. 27 • 2つのWorkflowを用意 ◦ Pull Request作成時に実行
◦ Pull Requestクローズ時に実行 GitHub Actionsの設定
© ZOZO Technologies, Inc. 28 • 2つのWorkflowを用意 ◦ Pull Request作成時に実行
▪ APKのビルド ▪ DeployGateへAPKのアップロード・配布ページの作成 ▪ Pull Requestへ配布ページURLをコメント ◦ Pull Requestクローズ時に実行 ▪ DeployGate配布ページを削除 GitHub Actionsの設定
© ZOZO Technologies, Inc. Pull Request作成時に実行されるWorkflow 29
© ZOZO Technologies, Inc. 30 name: Android CI on Pull
Request Open on: [pull_request] jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url: ${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" - name: Comment to Pull Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 31 name: Android CI on Pull
Request Open on: [pull_request] jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url: ${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" - name: Comment to Pull Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. on: [pull_request] 32 Pull Requestが作成されたタイミングでWorkflowをトリガー
© ZOZO Technologies, Inc. 33 name: Android CI on Pull
Request Open on: [pull_request] jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url: ${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" - name: Comment to Pull Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 34 name: Android CI on Pull
Request Open on: [pull_request] jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url: ${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" - name: Comment to Pull Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 35
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 36 配布ページURLを下流のstepに共有する設定
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 37
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 38 ビルドを実行してAPKを生成
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 39
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 40 DeployGateへAPKをアップロード/配布ページ作成
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 41 ブランチ名で配布ページを作成
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 42 レスポンスから配布ページURLを取得 jqがデフォルトで使えるので利用
© ZOZO Technologies, Inc. jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url:
${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | \ jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" 43 配布ページURLを下流のstepで利用できるようset
© ZOZO Technologies, Inc. 44 name: Android CI on Pull
Request Open on: [pull_request] jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url: ${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" - name: Comment to Pull Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 45 name: Android CI on Pull
Request Open on: [pull_request] jobs: build: runs-on: ubuntu-latest outputs: distribution_page_url: ${{ steps.distribute_app.outputs.distribution_page_url }} steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Build with Gradle run: ./gradlew assembleDebug - name: Distribute App id: distribute_app run: | distribution_page_url=$(curl \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "file=@app/build/outputs/apk/debug/app-debug.apk" \ -F "message=git-hash:`git rev-parse --short $GITHUB_SHA`" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/apps | jq -r .results.distribution.url) echo "::set-output name=distribution_page_url::$distribution_page_url" - name: Comment to Pull Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 46 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 47 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' }) octokit/rest.jsをstep内から実行可能にするaction JavaScriptでGitHub APIを制御
© ZOZO Technologies, Inc. 48 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 49 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' }) 配布ページURLをPull Requestへコメント
© ZOZO Technologies, Inc. 50
© ZOZO Technologies, Inc. 51 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 52 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' }) Pull Requestへのコメント一覧を取得
© ZOZO Technologies, Inc. 53 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' })
© ZOZO Technologies, Inc. 54 - name: Comment to Pull
Request uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | const comments = await github.paginate(github.issues.listComments, { issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, }) for (const comment of comments) { if (comment.body.includes("https://deploygate.com/distributions/")) { return // The URL for the distribution page has already been posted. } } github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: '配布ページを作成しました\n' + '${{ steps.distribute_app.outputs.distribution_page_url }}' }) コメントに配布ページURLが含まれているか確認 含まれていればreturn
© ZOZO Technologies, Inc. Pull Requestクローズ時に実行されるWorkflow 55
© ZOZO Technologies, Inc. 56 name: Android CI on Pull
Request Close on: pull_request: types: [closed] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Delete distribution page run: | curl \ -X DELETE \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/platforms/android/apps/com.horie1024.githubactionssample/distributions
© ZOZO Technologies, Inc. 57 name: Android CI on Pull
Request Close on: pull_request: types: [closed] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Delete distribution page run: | curl \ -X DELETE \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/platforms/android/apps/com.horie1024.githubactionssample/distributions
© ZOZO Technologies, Inc. on: pull_request: types: [closed] 58 Pull
Requestがクローズされたタイミングで Workflowをトリガー
© ZOZO Technologies, Inc. 59 name: Android CI on Pull
Request Close on: pull_request: types: [closed] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Delete distribution page run: | curl \ -X DELETE \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/platforms/android/apps/com.horie1024.githubactionssample/distributions
© ZOZO Technologies, Inc. 60 name: Android CI on Pull
Request Close on: pull_request: types: [closed] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Delete distribution page run: | curl \ -X DELETE \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/platforms/android/apps/com.horie1024.githubactionssample/distributions
© ZOZO Technologies, Inc. 61 name: Android CI on Pull
Request Close on: pull_request: types: [closed] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - name: Delete distribution page run: | curl \ -X DELETE \ -F "token=${{secrets.DEPLOYGATE_TOKEN}}" \ -F "distribution_name=$GITHUB_HEAD_REF" \ https://deploygate.com/api/users/${{secrets.DEPLOYGATE_USER}}/platforms/android/apps/com.horie1024.githubactionssample/distributions ブランチ名を指定して配布ページを削除
© ZOZO Technologies, Inc. 62 • これでGitHub Actionsの設定は完了 • サンプルリポジトリはこちら
• https://github.com/horie1024/github_actions_android_sample GitHub Actionsの設定
© ZOZO Technologies, Inc. 導入した結果 63
© ZOZO Technologies, Inc. 64 • ZOZOTOWNアプリチームではKPTを定期的に行っている ◦ iOS/Android/API/デザインの各チーム毎のKPT ◦
各チームを横断した全体のKPT • 配布ページの件はデザイナーチームからKeepとしてフィードバック KPT(Keep Problem Try)
© ZOZO Technologies, Inc. 65 「AndroidアプリのDeployGateによるデザイン確認を、2次元バーコードでインス トール画面に飛べるようにしてもらったので大変楽になりました。」 デザイナーからのフィードバック
© ZOZO Technologies, Inc. まとめ 66
© ZOZO Technologies, Inc. 67 まとめ • GitHub Actions +
DeployGateでAPKのビルドと配布を自動化 • デザイナーチームからポジティブなフィードバックを得た • UIの確認/検証の効率化につながっている
None