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
340
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
810
K/NでCryptoKit使いたかった
ryunen344
0
380
Other Decks in Programming
See All in Programming
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
210
CSC509 Lecture 14
javiergs
PRO
0
140
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
1
520
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Symfony Mapper Component
soyuka
2
730
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
330
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
4
1.1k
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
良いユニットテストを書こう
mototakatsu
5
2k
선언형 UI에서의 상태관리
l2hyunwoo
0
150
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Making the Leap to Tech Lead
cromwellryan
133
9k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Speed Design
sergeychernyshev
25
670
Thoughts on Productivity
jonyablonski
67
4.4k
Music & Morning Musume
bryan
46
6.2k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Practical Orchestrator
shlominoach
186
10k
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….