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
iOS リポジトリへの Renovate の導入
Search
Kenta Enomoto
July 05, 2023
Technology
2
340
iOS リポジトリへの Renovate の導入
Ebisu.mobile #3 の発表資料です。
https://hey.connpass.com/event/286007/
Kenta Enomoto
July 05, 2023
Tweet
Share
More Decks by Kenta Enomoto
See All by Kenta Enomoto
STORES ブランドアプリのスケールするアプリづくり
enomotok
0
15
What's new in Xcode 16 ダイジェスト
enomotok
0
600
Introducing Pkl
enomotok
0
2.3k
iOS開発とGitLab CI
enomotok
7
4k
ポモドーロテクニックについて
enomotok
0
120
リーダブルコード読書会 #1
enomotok
0
290
Other Decks in Technology
See All in Technology
HCP TerraformとAzure:イオンスマートテクノロジーのインフラ革新 / HCP Terraform and Azure AEON Smart Technology's Infrastructure Innovation
aeonpeople
3
1k
extensionとschema
yahonda
1
100
消し忘れリソースゼロへ!私のResource Explorer活用法
cuorain
0
140
Amazon Location Serviceを使ってラーメンマップを作る
ryder472
2
160
Zenn のウラガワ ~エンジニアのアウトプットを支える環境で Google Cloud が採用されているワケ~ #burikaigi #burikaigi_h
kongmingstrap
19
7k
[TechNight #86] Oracle GoldenGate - 23ai 最新情報&プロジェクトからの学び
oracle4engineer
PRO
1
190
Tech Blog執筆のモチベート向上作戦
imamura_ko_0314
0
760
Creative Pair
kawaguti
PRO
1
140
あなたの興味は信頼性?それとも生産性? SREとしてのキャリアに悩むみなさまに伝えたい選択肢
jacopen
6
3.6k
Grid表示のレイアウトで Flow layoutsを使う
cffyoha
1
150
君はPostScriptなウィンドウシステム 「NeWS」をご存知か?/sunnews
koyhoge
0
330
企業テックブログにおける執筆ネタの考え方・見つけ方・広げ方 / How to Think of, Find, and Expand Writing Topics for Corporate Tech Blogs
honyanya
0
830
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
YesSQL, Process and Tooling at Scale
rocio
171
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
A designer walks into a library…
pauljervisheath
205
24k
Making Projects Easy
brettharned
116
6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
Statistics for Hackers
jakevdp
797
220k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
220
Facilitating Awesome Meetings
lara
51
6.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Transcript
2023-07-05 Ebisu.mobile #3 STORES 株式会社 榎本健太 iOS リポジトリへの Renovate の導入
自己紹介 2 榎本 健太 STORES 株式会社 STORES ブランドアプリチーム iOS エンジニア
2023年5月入社 twitter.com/enomotok_ github.com/enomoto
ライブラリの更新を自動化するモチベーション 3 • 機能追加 • バグフィックス • セキュリティリスクの低減 • ビッグリリースを避ける
とはいえ手作業で行うのは大変
Renovate とは 4 依存関係の自動更新をサポートするためのツール 依存しているライブラリのリリースを検知 アップデートのための Pull Request を自動で作って くれる
同様のサービスとして Dependabot がある https://github.com/apps/renovate
Renovate の導入方法 5 GitHub App をインストールするだけで簡単に導入で きる Swift Package Manager
CocoaPods regexManagers の設定が必要なケース Carthage XcodeGen でプロジェクトの構成管理をしている
Renovate の導入方法 6 [pull request] Configure Renovate
Renovate の導入方法 7 [pull request] Configure Renovate
renovate.json 8 { "$schema": "https://docs.Renovatebot.com/Renovate-schema.json", "extends": [ "config:base" ], "schedule":
[ "every weekend" # Pull Request を作成するタイミング ], "labels": [ "Renovate" # Pull Request に付与するラベル ], "packageRules": [ # ライブラリ毎に細かいルールを設定できる { "excludePackageNames": ["onevcat/Kingfisher"] # 更新対象から除外する } ] }
困ったこと、工夫したこと 9 • XcodeGen で構成管理しているプロジェクトでは regexManagers の設定 が必要 • Package.resolved
が更新されない問題
regexManagers とは 10 regexManagers では正規表現を使ってライブラリ名とバージョン番号をキャプ チャ renovate.json に設定を記載
regexManagers による、ライブラリ名とバージョン番号の検知 11 project.yml (抜粋) packages: Firebase: url: https://github.com/firebase/firebase-ios-sdk from:
8.0.0 renovate.json (抜粋) "regexManagers": [ { "fileMatch": [ "^project.yml$" ], "matchStrings": [ "url: https:\\/\\/github\\.com\/(?<depName>.*?)(\\.git)?\\s*from: (?<currentValue>.*?)\\s" ], "datasourceTemplate": "github-releases" } ]
Package.resolved が更新されない問題 12 PR が生成されるタイミングで差分をコミットするようにしている CI の途中で以下の Shell Script を呼び出す
#!/usr/bin/env bash set -eo pipefail # ここで依存解決をしているのは、ライブラリのリポジトリに含めているデモ用のプロジェクト xcodebuild -project "Appmaker-Demo/Appmaker-Demo.xcodeproj" -resolvePackageDependencies diff_result=$(git diff --name-only) if [[ "$diff_result" == *"Package.resolved"* ]]; then git ls-files | grep 'Package.resolved$' | xargs git add git commit -m "Update Package.resolved [skip ci]" # bitrise で使用しているスクリプトの抜粋なので bitrise の環境変数を参照します git push origin HEAD:$BITRISE_GIT_BRANCH fi
自分の環境で手軽に試す方法 13 チュートリアル README.md の通りにぽちぽちしていくだけで簡単に試せる https://github.com/Renovatebot/tutorial iOS のリポジトリで試したい GitHub で公開されているリポジトリを
fork して、自分で設定してみると よい https://github.com/pointfreeco/isowords とか
参考URL 14 https://docs.renovatebot.com/ https://speakerdeck.com/ikesyo/renovateniyoruiosraiburarifalsezi-dong- geng-xin https://qiita.com/_asa08_/items/b0be1453f70efb3b9c29 https://tech.dely.jp/entry/2020/12/04/102515
おわり 15 ありがとうございました