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.7k
Okioに愛を込めて
ryunen344
3
1.9k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
1.5k
Xcode Meets Gradle
ryunen344
0
320
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
ryunen344
0
340
K/NとNSKeyedArchiverと私
ryunen344
0
470
ComposeのModalBottomSheetは (まだ)沼
ryunen344
1
1.6k
うわっ…もしかして私のコー ド、遅すぎ…?
ryunen344
1
830
K/NでCryptoKit使いたかった
ryunen344
0
390
Other Decks in Programming
See All in Programming
Rubyでつくるパケットキャプチャツール
ydah
0
180
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
410
情報漏洩させないための設計
kubotak
5
1.3k
テストコード書いてみませんか?
onopon
2
340
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.2k
functionalなアプローチで動的要素を排除する
ryopeko
1
220
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
為你自己學 Python
eddie
0
520
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4.2k
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
4 Signs Your Business is Dying
shpigford
182
22k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Why Our Code Smells
bkeepers
PRO
335
57k
How to Ace a Technical Interview
jacobian
276
23k
Being A Developer After 40
akosma
89
590k
Bash Introduction
62gerente
610
210k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
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….