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
320
SwiftPM with KMMをprivateなGitHub Releaseで運用する
RyuNen344
August 30, 2022
Tweet
Share
More Decks by RyuNen344
See All by RyuNen344
サプライチェーン攻撃に備える
ryunen344
0
1.4k
Okioに愛を込めて
ryunen344
3
1.7k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
1.4k
Xcode Meets Gradle
ryunen344
0
300
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
ryunen344
0
330
K/NとNSKeyedArchiverと私
ryunen344
0
440
ComposeのModalBottomSheetは (まだ)沼
ryunen344
1
1.5k
うわっ…もしかして私のコー ド、遅すぎ…?
ryunen344
1
800
K/NでCryptoKit使いたかった
ryunen344
0
360
Other Decks in Programming
See All in Programming
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
670
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Ethereum_.pdf
nekomatu
0
460
cmp.Or に感動した
otakakot
3
170
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Click-free releases & the making of a CLI app
oheyadam
2
120
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
920
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Optimizing for Happiness
mojombo
376
70k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Gamification - CAS2011
davidbonilla
80
5k
It's Worth the Effort
3n
183
27k
Rails Girls Zürich Keynote
gr2m
94
13k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Designing Experiences People Love
moore
138
23k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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….