Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
FlutterアプリのiOSビルドとアーカイブを CircleCI で自動化してみた / Tried automating the iOS build and archive of the Flutter app with CircleCI
Search
bake0937
September 08, 2021
Technology
0
930
FlutterアプリのiOSビルドとアーカイブを CircleCI で自動化してみた / Tried automating the iOS build and archive of the Flutter app with CircleCI
ラクスR&D Meetup - Flutter での登壇資料です。
https://rakus.connpass.com/event/220540/
bake0937
September 08, 2021
Tweet
Share
More Decks by bake0937
See All by bake0937
GASを使って非エンジニアが AWS Step Functions を 操作できる仕組みの紹介 / Introducing how non-engineers can operate AWS Step Functions using GAS
bake0937
0
240
CircleCI の有料プランを導入するためにやったこと/What I did to introduce CircleCI's paid plan
bake0937
0
1k
Probot で学ぶ TypeScript / Learn with Probot TypeScript
bake0937
0
110
Amazon ECR を利用していたと思ったら、Docker Hub を利用し続けていた / If I thought I was using Amazon ECR, I continued to use Docker Hub
bake0937
0
730
Jest + Puppeteer によるE2Eテストで確認作業を短縮してみた / End-to-end testing by Jest + Puppeteer shortened the confirmation work
bake0937
0
540
所属企業の Advent Calendar を初めて作った時に学んだこと / What I learned when I first created my company's Advent Calendar
bake0937
1
680
Notion 📚 へ移行して 3ヶ月経った振り返り / Looking back at Notion after 3 months
bake0937
0
5.6k
Bot開発でRubyを学ぶ / Learn Ruby with Bot Development
bake0937
0
370
小さく始めるOSS活動
bake0937
0
83
Other Decks in Technology
See All in Technology
滑空スポーツ講習会2023 航空安全講習会 第4回 日常整備に役立ちそうな雑情報 / JSA Safety Seminar 2023 glider maintenance
jsaseminar
0
110
マイクロサービスを横断したGoのコードレビュー
yuyu_hf
PRO
1
120
令和最新版 ソフトウェアエンジニアのためのDJ入門、あるいはDJに学ぶ仕事術 #ya8
stefafafan
1
140
どうやってWebサービスのページ表示速度を1/3にしたか / how-to-reduce-display-speed
pinkumohikan
2
470
SmartHR プロダクトエンジニア求人ガイド 2024上期
smarthr
0
130
新卒1年目がプロジェクトを進めるときにコケたポイント
ryunakayama
1
110
How to Build a Strong Engineering Culture
alperhankendi
0
120
Beginner's Guide to Partitioning vs. Sharding in Postgres | Claire Giordano | Nordic PGDay 2024
clairegiordano
0
210
layerx-0-to-1-product-development-in-compound-startups
shnjtk
1
520
We Fear Change, for DevOpsDays LA 2024
cote
PRO
0
130
DevOps Topologies 10 years on: what have we learned about silos, collaboration, and flow? - Matthew Skelton, Conflux
matthewskelton
PRO
2
420
5分で理解するWebAssemblyのWebの外の話 PHPはマイコンの夢を見るか?
usuyuki
3
200
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
355
22k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Faster Mobile Websites
deanohume
296
30k
Documentation Writing (for coders)
carmenintech
59
3.7k
How to Ace a Technical Interview
jacobian
272
22k
What's in a price? How to price your products and services
michaelherold
236
11k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
28
5.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
The Pragmatic Product Professional
lauravandoore
24
5.7k
Building Adaptive Systems
keathley
29
1.8k
It's Worth the Effort
3n
180
27k
Transcript
FlutterアプリのiOSビルドとアーカイブを CircleCI で自動化してみた 岡部恭平 / CO-OP Sapporo 2021.9.8 / ラクスR&D
Meetup - Flutter
自己紹介 生活協同組合コープさっぽろ デジタル推進本部 システム部 AWS・エンジニアリングチーム エンジニア 岡部恭平 @okabeeeat Webアプリケーションエンジニア
コープさっぽろDX 引用: https://dx.sapporo.coop/
最近やっていること • 社内ツール開発 ◦ Saasと社内システムの連携 ▪ Node.js + TypeScript ▪
AWSによるサーバレスな構成 • Developer eXperience の推進 ◦ CI/CDの構築、開発フローの整備、bot開発など
目次 • 背景 • 目的 • 方法 • 構成 •
まとめ
背景 ・・・ 引用: https://dx.sapporo.coop/n/n23376af197fa
背景 ・・・ 引用: https://dx.sapporo.coop/n/n23376af197fa
Flutter のプロジェクトが 始まったっぽい
そんな中 ビルドが辛いので自動化し たい! Aさんはビルドできるの に私はできません エンジニア なるほどね 私
目的 CI/CD環境を構築し、ビルドの自動化と属 人化の解消を実現する
作業スタート時 まぁアレだろ! Ruby on Rails や Vue CLI アプリのCI/CD 環境と似た感じなものを作れば良いんでしょ!
主な経験言語 Ruby, JavaScript, PHP
数時間後... 証明書って何? Apple Developer? Bitrise? Codemagic? CircleCIじゃダメなの? iOSビルドとアーカイブって何 が違うの? そもそも
Dart 触ったこと無 かったわ
内容を整理する • iOSアプリのビルド及び配布をするためには以下の工程が必要 ◦ Apple Developer アカウントの作成 ◦ ビルド ◦
証明書の作成・設定 ◦ アーカイブ ◦ 配布 • Flutterアプリ開発でよく使われてそうなCI/CDサービス ◦ Bitrise ◦ Codemagic ◦ GitHub Actions ◦ Cirrus CI(Dockerイメージでよく見かける) • CircleCI でもCI/CD環境を構築する方法はある(最近有料化したばっかりでして...)
そこからさらに調査...
方法 良さそうな方法が2つに絞られた ①CircleCI + fastlane ②CircleCI + Apple Store Connect
API + Codemagic CLI tools
①CircleCI + fastlane • 公式で紹介されている方法 • Apple Developerのアカウントが必要 • 証明書無しでiOSビルド
→ fastlane で証明書の生成・取得・設定 し、アーカイブを実行 • 証明書を管理するためのリポジトリが必要 ◦ え?証明書のためだけにリポジトリが必要なの!? fastlane とは? • iOS/Android のビルドやリリース作業を自動するツール
公式: https://flutter.dev/docs/deployment/ios#create-a-build-archive-with-codemagic-cli-tools ②CircleCI + Apple Store Connect API + Codemagic
CLI tools • 公式に書いてある方法を CircleCI で実行する方法 • Codemagic CLI tools + Apple Store Connect API で 証明書の取 得・設定をする ◦ Codemagic CLI tools 自体は無料で使える • 「flutter build ipa」でアーカイブまで一気に実行 • 証明書を管理するためのリポジトリが不要になりそう
どっちにしたの? ①CircleCI + fastlane ②CircleCI + Apple Store Connect API
+ Codemagic CLI tools
本当は②にしたかった... • ローカル環境(macOS)では成功 • CircleCI のコンテナデバッグで検証 ◦ macOS(xcode: 12.5.1)で失敗 •
惜しいところまでいったが時間切れに ◦ あと少し時間があったら..(言い訳) 検証用に仮で置いている (現在は削除済み)
気を取り直して①で進める
構成① 証明書管理リポジトリ
構成② iOSビルド構成
サンプルコード等 後日ブログ等にまとめます
結果 無事自動化できた🎉
結果 • ビルドが自動化された ◦ 本来の開発に集中できる • 属人化が解消された ◦ 誰かによる手動のビルド作業が無くなった ◦
開発者は Flutter のコードを push するだけで良い ◦ Apple Developer への登録も不要
今後やること • iOSアプリの配信の自動化 • Androidアプリのビルド・配信の自動化
まとめ • iOSアプリのビルドとアーカイブを CircleCI で自動化した • CI/CD環境の実現方法は CircleCI + fastlane
を採用した • FlutterというよりiOSアプリを配信するまでの作業をキャッチ アップできた
参考 • Continuous delivery with Flutter ◦ https://flutter.dev/docs/deployment/cd#integrating-fastlane-with-existing-workflows • Build
and release an iOS app ◦ https://flutter.dev/docs/deployment/ios#create-a-build-archive-with-codemagic-cli-tools • `flutter build ipa` でiOS向けのビルドとアーカイブを同時に実行 ◦ https://medium.com/flutter-jp/ipa-e176de0276c6 • CircleCI 2.1 と fastlane で Flutter の iOS と Android をビルドして DeployGate で配布する ◦ https://qiita.com/masashi-sutou/items/08c4d4eb5b9cb2dcd47a • fastlane match を使用して iOS の証明書管理を行う ◦ https://qiita.com/kotarella1110/items/840af2cf80aaea1fb035 • fastlaneでCode Signing StyleをAutomaticからManualに変更する ◦ https://tech.studyplus.co.jp/entry/2018/05/28/115637
ご清聴ありがとうございました