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
SwiftPM with KMMをprivateなGitHub Releaseで運用する
Search
RyuNen344
August 30, 2022
Programming
0
390
SwiftPM with KMMをprivateなGitHub Releaseで運用する
RyuNen344
August 30, 2022
Tweet
Share
More Decks by RyuNen344
See All by RyuNen344
WindowInsetsだってテストしたい
ryunen344
1
270
サプライチェーン攻撃に備える
ryunen344
0
2.7k
Okioに愛を込めて
ryunen344
3
2.4k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
1.8k
Xcode Meets Gradle
ryunen344
0
360
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
ryunen344
0
390
K/NとNSKeyedArchiverと私
ryunen344
0
530
ComposeのModalBottomSheetは (まだ)沼
ryunen344
1
1.8k
うわっ…もしかして私のコー ド、遅すぎ…?
ryunen344
1
940
Other Decks in Programming
See All in Programming
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
150
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
150
新世界の理解
koriym
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
180
パスタの技術
yusukebe
1
400
Laravel Boost 超入門
fire_arlo
1
130
Flutterと Vibe Coding で個人開発!
hyshu
1
270
TanStack DB ~状態管理の新しい考え方~
bmthd
2
340
書き捨てではなく継続開発可能なコードをAIコーディングエージェントで書くために意識していること
shuyakinjo
1
310
サイトを作ったらNFCタグキーホルダーを爆速で作れ!
yuukis
0
500
Infer入門
riru
4
1.6k
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
840
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Unsuck your backbone
ammeep
671
58k
Speed Design
sergeychernyshev
32
1.1k
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
Agile that works and the tools we love
rasmusluckow
329
21k
GitHub's CSS Performance
jonrohan
1031
460k
Optimizing for Happiness
mojombo
379
70k
Being A Developer After 40
akosma
90
590k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Transcript
SwiftPM with KMMΛprivate ͳGitHub ReleaseͰӡ༻͢Δ 2022.08.30 Mobileษڧձ Wantedly × νʔϜϥϘ
#6 Bunjiro Miyoshi
About Me • νʔϜϥϘॴଐ • (ࣗশ)ϚϧνϓϥοτϑΥʔϜܳਓ • ࠷ۙগ͠TypeScriptͱྑͯ͘͠·͢
͢͜ͱɾ͞ͳ͍͜ͱ • ͢͜ͱ • private multi repoڥͰͷKMM(ͱ͍͏ΑΓόΠφϦʔ)ΛSwiftPMͰऔΓࠐ Ήํ๏ • ͞ͳ͍͜ͱ
• KMMͱ • SwiftPM༻ͷPackage.swiftϑΝΠϧੜํ๏ • GitHub APIΛͬͨasset urlͷऔಘํ๏
KMMΛiOSʹ͢Δํ๏ on private repo • GitHub Repositoryʹஔ͍ͪΌ͏ • S3ͳͲͷΫϥυετϨʔδʹஔ͍ͪΌ͏ •
GitHub ReleaseͷAssetʹஔ͍ͪΌ͏
GitHub Repositoryʹஔ͍ͪΌ͏ • ιʔείʔυͱಉډͤ͞Δ͔artifact༻ͷrepositoryΛ࡞Δ • 😍ׂͱࡶʹߏஙͰ͖ΔͷͰָ • 😩͕࣌ؒܦͯܦͭ΄Ͳgit clone͕ΊͬͪΌ͘ͳΔ
S3ͳͲͷΫϥυετϨʔδʹஔ͍ͪΌ͏ • 😍͍҆ͷͰ༰ྔʹ͔͔Δίετͷ͋Ε͜Ε͋ΔఔແࢹͰ͖Δ • 😩IAMཧIP੍ݶͳͲGitHubҎ֎Ͱߦ͏ઃఆ͕ଟ͍ • 😩pod spec repositoryผͰ࡞͢Δඞཁ͕͋Δ
GitHub ReleaseͷAssetʹஔ͍ͪΌ͏ • 😍PAT͑͋͞ΕͳΜͰ͍͚Δ • 😩podͷ߹spec repositoryΛผ్࡞͢Δඞཁ͕͋Δ
͍ΖΜͳϖʔδʹΞΫηε͢Δͷ͍ ͳͷͰGitHubͰ͍݁ͤͨ͞
KMM with CocoaPods on GH Assets • marty-suzuki͞Μ͕ެ։͍ͯͩͬͯ͘͠͞Δpod specϑΝΠϧΛ͏ •
https://speakerdeck.com/martysuzuki/iosnikmmwodao-ru-surutips GitHub্Ͱͯ͢४උͰ͖Δ͜͠ΕͰ४උສ😊 ͱࢥ͍ͬͯͨΒɾɾɾɾ
👉 iOSΤϯδχΞ͔Βͷ͍ཁ͕ɾɾɾɾ ࣌ͷྲྀΕ
KMM with SwiftPM on GH Assets • GitHub ReleaseͷAssetsΛ͏ࡍʹඞཁͳ͜ͱ •
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • Http Request࣌ͷೝূΛΓӽ͑Δ • Contetn-TypeɿOctet-StreamͰϦΫΤετ͢Δ
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • ஔ͢ΔzipϑΝΠϧ͕ల։͞Εͨͱ͖ͷϑΥϧμ໊ʹϧʔϧ͕͋Δ • $(framworkName).xcframeworkͱ͍͏ϑΥϧμʹల։͞ΕΔΑ͏ʹ ͢Δ
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ 👉 ల։͢Δͱ
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • gradleͰରԠͨ͠zipϑΝΠϧΛ࡞͢Δ • assembleXCFrameworkίϚϯυͱzipؔΛ༻͢ΕΑ͍
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • assembleXCFrameworkbuildσΟϨΫτϦʹXCframeworkΛੜ ͢Δ
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • assembleXCFrameworkbuildσΟϨΫτϦʹXCframeworkΛੜ ͢Δ ͜ͷ෦Λzip͢ΕΑ͍
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • ͜Μͳgradle taskΛ࡞ͬͯ͋͛ΕΑ͍
SwiftPMʹରԠͨ͠zipϑΝΠϧͷߏʹ͢Δ • IDE্ͰzipϑΝΠϧΛ͍ͨͱ͖ʹ͜͏ͳ͍ͬͯΕOK
Http Request࣌ͷೝূΛΓӽ͑Δ • .netrcΛ͏ • ઃఆ͢ΔͱΑ͠ͳʹೝূΛΓӽ͑ͯ͘ΕΔ • https://www.gnu.org/software/inetutils/manual/html_node/The- _002enetrc- fi
le.html • Xcode12.5͔ΒରԠͨ͠ • https://github.com/apple/swift-package-manager/pull/2833 • ͜ΕͰAuthorization: token $(pat)ͰϦΫΤετͯ͘͠ΕΔΑ͏ʹͳͬͨ
Http Request࣌ͷೝূΛΓӽ͑Δ • assetsͷURLhttps://api.github.com/repos/$(org)/$(repository)/ releases/assets/$(asset_id)ʹͳΔͨΊɺೝূapi.github.comʹઃఆ ͢Δ
Octet-StreamͰϦΫΤετ͢Δ • asset urlΛϦΫΤετ͢ΔͱόΠφϦͱͯ͠ೝࣝ͞Εͳ͍ • suzuki͞ΜͷൃදͰ৮ΕΒΕ͍ͯ·ͨ͠ • .binary(…)ͷܗͰએݴ͞ΕͨύοέʔδͷμϯϩʔυϦΫΤετ࣌ ʹoctet-stream͕༩͞ΕΔରԠ͕Xcode13.3ʹಋೖ͞Εͨ •
https://github.com/apple/swift-package-manager/pull/3795
Octet-StreamͰϦΫΤετ͢Δ • ࠓ·ͰͷΛ౷ׅ͢Δͱ͜Μͳهड़ͳͣ….
Octet-StreamͰϦΫΤετ͢Δ • ࠓ·ͰͷΛ౷ׅ͢Δͱ͜Μͳهड़ͳͣ…. ಈ͔ͳ͍ɾɾɾɾ😱
Octet-StreamͰϦΫΤετ͢Δ • https://github.com/apple/swift-package-manager/pull/3795 • 👆ͷPRΛݟͯΈΔͱ.zipͰऴΘΔURLʹରͯ͠ςετΛॻ͍͍ͯΔ • ͪΐͬͱιʔεΛಡΜͰݟΔͱ͋Ε͜Ε͍ͬͯΔͷSources/ Workspace/Workspace+BinaryArtifacts.swiftͬΆ͍
SwiftPM༻ʹzipϑΝΠϧΛ࡞Δͱ͖ͷ͋Ε͜Ε • Workspace+BinaryArtifacts.swiftൈਮ .zipͰURLͰ fi lter͔͚ͯΔ😳 (छྨΘ͔Βͳ͔ͬͨͲͷϔομʔ͚͍͍͔ͭͯΘ͔Βͳ͍ͦ͠Εͦ͏)
Octet-StreamͰϦΫΤετ͢Δ ಈ͍ͨ😚
·ͱΊ • SwiftPM༻ͷXCFrameworkͷzipϑΝΠϧల։࣌ʹ.xcframework͕ ݟΔΑ͏ͳzipϑΝΠϧʹ͢Δඞཁ͕͋Δ • GitHub ReleaseͷassetsʹSwiftPMͰΞΫηεͤ͞Δʹ.netrcΛ͏ • SwiftPM.zipͰऴΘΔURL͡Όͳ͍ͱoctet-streamΛheaderʹ༩͠ ͯ͘Εͳ͍ͷͰURLΛzipͰऴΘΔΑ͏ʹ͢Δ
KMMʹSwiftPMΛͬͯ֎෦ϥΠϒ ϥϦΛऔΓࠐΉฤʹଓ͘ to be continued….