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
350
SwiftPM with KMMをprivateなGitHub Releaseで運用する
RyuNen344
August 30, 2022
Tweet
Share
More Decks by RyuNen344
See All by RyuNen344
サプライチェーン攻撃に備える
ryunen344
0
1.6k
Okioに愛を込めて
ryunen344
3
1.8k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
1.5k
Xcode Meets Gradle
ryunen344
0
310
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
ryunen344
0
330
K/NとNSKeyedArchiverと私
ryunen344
0
450
ComposeのModalBottomSheetは (まだ)沼
ryunen344
1
1.6k
うわっ…もしかして私のコー ド、遅すぎ…?
ryunen344
1
820
K/NでCryptoKit使いたかった
ryunen344
0
380
Other Decks in Programming
See All in Programming
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
270
情報漏洩させないための設計
kubotak
4
920
fs2-io を試してたらバグを見つけて直した話
chencmd
0
250
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
780
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
410
CloudflareStack でRAGに入門
asahiiwm
0
130
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
1
300
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
350
nekko cloudにおけるProxmox VE利用事例
irumaru
3
470
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
670
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.1k
Оптимизируем производительность блока Казначейство
lamodatech
0
730
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
328
21k
Making the Leap to Tech Lead
cromwellryan
133
9k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Making Projects Easy
brettharned
116
6k
Designing for Performance
lara
604
68k
Adopting Sorbet at Scale
ufuk
74
9.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
What's in a price? How to price your products and services
michaelherold
244
12k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Done Done
chrislema
182
16k
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….