Abhishek Agarwal
08/20/2024, 7:01 AMshared
, :shared:featureA
, :shared:featureB
, etc.) and does not include a settings.gradle
or gradle.properties
file. I want to publish the KMM code as an SPM package for iOS, but I don’t want to publish any AAR files since Android developers are already using the KMM module directly as a regular module. My goal is to ensure that all tags and packages, including the Package.swift
file, are managed within the KMM repository. Can anyone recommend resources or guidance on setting up KMMBridge for this scenario?Bradleycorn
08/20/2024, 2:29 PMBradleycorn
08/20/2024, 2:31 PMkpgalligan
08/20/2024, 4:01 PMkpgalligan
08/20/2024, 4:05 PM1.0.0-alpha1
. Template here: https://github.com/touchlab/KMMBridgeSPMQuickStart. The new KMMBridge version is very focused on SPM and removes a lot of the dev versioning complexity of previous versions. It also lets you add the binary XCFramework zip as a release artifact rather than using GitHub Packages.kpgalligan
08/20/2024, 4:05 PMAbhishek Agarwal
08/21/2024, 11:56 AMkpgalligan
08/21/2024, 1:44 PMkpgalligan
08/21/2024, 1:46 PMkpgalligan
08/21/2024, 1:47 PMmain
branch https://github.com/touchlab/KMMBridgeSPMQuickStart/blob/main/Package.swiftAbhishek Agarwal
08/21/2024, 1:48 PMkpgalligan
08/21/2024, 1:48 PMkpgalligan
08/21/2024, 1:48 PMkpgalligan
08/21/2024, 1:49 PMAbhishek Agarwal
08/21/2024, 1:49 PMkpgalligan
08/21/2024, 1:50 PMAbhishek Agarwal
08/21/2024, 1:50 PMAbhishek Agarwal
08/21/2024, 1:51 PMkpgalligan
08/21/2024, 1:51 PMkpgalligan
08/21/2024, 1:52 PMkpgalligan
08/21/2024, 1:52 PMAbhishek Agarwal
08/21/2024, 1:52 PMkpgalligan
08/21/2024, 1:53 PMkpgalligan
08/21/2024, 1:53 PMAbhishek Agarwal
08/21/2024, 1:53 PM{
"message": "Not Found",
"documentation_url": "<https://docs.github.com/rest/releases/assets#get-a-release-asset>",
"status": "404"
}
kpgalligan
08/21/2024, 1:55 PMAbhishek Agarwal
08/21/2024, 1:56 PMkpgalligan
08/21/2024, 1:57 PMAbhishek Agarwal
08/21/2024, 2:23 PMcurl -n <https://api.github.com/user>
from my terminal returns a valid responsekpgalligan
08/21/2024, 2:37 PMkpgalligan
08/21/2024, 2:38 PMgh release list
to get the release, then gh release view
to see the assets. I think that'll show the "real" url of the file. Long story, but you need it.kpgalligan
08/21/2024, 2:39 PMkpgalligan
08/21/2024, 2:39 PMAbhishek Agarwal
08/21/2024, 2:54 PMkpgalligan
08/21/2024, 2:55 PMkpgalligan
08/21/2024, 2:56 PMAbhishek Agarwal
08/21/2024, 2:56 PMtest@Abhs-MacBook-Pro ~ % curl -n <https://api.github.com/repos/programmer/SPMKMM/releases/assets/187399888.zip>
{
"url": "<https://api.github.com/repos/programmer/SPMKMM/releases/assets/187399888>",
"id": 187399888,
"node_id": "RA_kwDOMmS-vM4LK37Q",
"name": "allshared.xcframework.zip",
"label": "",
"uploader": {
"login": "github-actions[bot]",
kpgalligan
08/21/2024, 2:56 PMAbhishek Agarwal
08/21/2024, 2:57 PMkpgalligan
08/21/2024, 2:57 PMAbhishek Agarwal
08/21/2024, 2:57 PMkpgalligan
08/21/2024, 2:57 PMAbhishek Agarwal
08/21/2024, 2:58 PMmachine <http://api.github.com|api.github.com>
login programmer
password ghp_YP4WtzH2FDJFJDJFJ09LFb9
Abhishek Agarwal
08/21/2024, 2:58 PMkpgalligan
08/21/2024, 2:58 PMAbhishek Agarwal
08/21/2024, 2:59 PMkpgalligan
08/21/2024, 2:59 PMkpgalligan
08/21/2024, 3:00 PMAbhishek Agarwal
08/21/2024, 3:01 PMAbhishek Agarwal
08/21/2024, 3:01 PMkpgalligan
08/21/2024, 3:01 PMkpgalligan
08/21/2024, 3:02 PMAbhishek Agarwal
08/21/2024, 3:02 PMAbhishek Agarwal
08/21/2024, 3:03 PMThis whole process is a pain, though. Wish I had extra free time. I'd write some kind of "check your config" cli command.That would be really helpful!.
kpgalligan
08/21/2024, 3:04 PMAbhishek Agarwal
08/21/2024, 3:07 PMkpgalligan
08/21/2024, 3:19 PMAbhishek Agarwal
08/21/2024, 3:23 PMSPM config screen
Are you talking about this ?Abhishek Agarwal
08/21/2024, 3:24 PMkpgalligan
08/21/2024, 3:36 PMcould you please explain a bit , I didn't gotThe screenshots you sent are what I was talking about.Are you talking about this ?SPM config screen
kpgalligan
08/21/2024, 3:38 PMkpgalligan
08/21/2024, 3:39 PMkpgalligan
08/21/2024, 3:40 PMAbhishek Agarwal
08/21/2024, 3:40 PMPackage.swift
file that I'm hoping you can clarify. The URL for the GitHub release asset is structured like this:
<https://api.github.com/repos/owner/repo/releases/assets/asset_id.zip>
However, I've found that this URL doesn't actually allow direct downloading of the asset. When I use curl to access the API endpoint
curl -n <https://api.github.com/repos/owner/repo/releases/assets/asset_id>
It returns a JSON response containing a browser_download_url
, which seems to be the actual URL for downloading the asset as I can download the zip from my browser (in which I have already logged in )
This raises a few questions:
1. Is the current URL in Package.swift
correct? It seems like Xcode wouldn't be able to download the asset using this URL.
2. Shouldn'twe be using the browser_download_url
instead? I noticed that previous versions of KMMBridge used a downloadable URL directly. https://github.com/touchlab/KMMBridgeSKIETemplate/blob/7f16a56c98c5f2f3989233c78b6beb784771cf07/Package.swiftAbhishek Agarwal
08/21/2024, 3:41 PMkpgalligan
08/21/2024, 3:42 PMkpgalligan
08/21/2024, 3:42 PMSure sending you the invitation. Could you please help me with your github usernamekpgalligan
Abhishek Agarwal
08/21/2024, 3:43 PMAbhishek Agarwal
08/21/2024, 3:45 PMkpgalligan
08/21/2024, 3:58 PMkpgalligan
08/21/2024, 4:08 PMkpgalligan
08/21/2024, 4:09 PMkpgalligan
08/21/2024, 4:09 PMAbhishek Agarwal
08/21/2024, 4:10 PMkpgalligan
08/21/2024, 4:11 PMkpgalligan
08/21/2024, 4:12 PMAbhishek Agarwal
08/21/2024, 4:12 PMAbhishek Agarwal
08/21/2024, 4:13 PMThis whole process sucks, though. You're not the first to have this kind of issue. There are many moving parts that can fail, and the error messages aren't helpful.is it stable enough to use in prod as I am planing to do so ?
kpgalligan
08/21/2024, 4:13 PMkpgalligan
08/21/2024, 4:15 PMis it stable enough to use in prod as I am planing to do so ?Yeah, it's fine. The config sucks. Prod is super stable. Ironically, it's SPM, Xcode, and GitHub being extra careful, but not extra helpful. Once it's set up, you'll forget about it. My config works because it was set up a while ago, so I just needed to be invited to your repo. Assuming other devs will use this, make sure you very clearly document the setup.
kpgalligan
08/21/2024, 4:16 PMAbhishek Agarwal
08/21/2024, 4:23 PMAbhishek Agarwal
08/21/2024, 4:33 PMYeah, it's fine. The config sucks. Prod is super stable. Ironically, it's SPMTried recreating the netrc file but it's still not working for me!.
kpgalligan
08/21/2024, 4:43 PMAbhishek Agarwal
08/21/2024, 4:49 PMAbhishek Agarwal
08/21/2024, 4:51 PMkpgalligan
08/21/2024, 5:04 PMkpgalligan
08/21/2024, 5:05 PMkpgalligan
08/21/2024, 5:07 PMkpgalligan
08/21/2024, 5:08 PMkpgalligan
08/21/2024, 5:10 PMkpgalligan
08/21/2024, 5:10 PMAbhishek Agarwal
08/21/2024, 5:12 PMkpgalligan
08/21/2024, 5:17 PMmachine <http://api.github.com|api.github.com>
login kpgalligan
password ---
That is the entirety of mine.Abhishek Agarwal
08/21/2024, 5:22 PMkpgalligan
08/21/2024, 5:24 PMBut AFAIK, github uses authentication for public repo too ?It does.
Abhishek Agarwal
08/21/2024, 5:25 PMkpgalligan
08/21/2024, 5:25 PMAbhishek Agarwal
08/21/2024, 5:26 PMkpgalligan
08/21/2024, 5:26 PMAbhishek Agarwal
08/21/2024, 5:26 PMkpgalligan
08/21/2024, 5:26 PMAbhishek Agarwal
08/21/2024, 5:27 PMkpgalligan
08/21/2024, 5:28 PMAbhishek Agarwal
08/21/2024, 5:28 PMAbhishek Agarwal
08/21/2024, 5:28 PMAbhishek Agarwal
08/22/2024, 4:44 AMkpgalligan
08/22/2024, 2:07 PMkpgalligan
08/22/2024, 2:08 PMkpgalligan
08/22/2024, 2:10 PMAbhishek Agarwal
08/22/2024, 2:57 PMkpgalligan
08/22/2024, 3:25 PMAbhishek Agarwal
08/22/2024, 3:31 PMAbhishek Agarwal
08/22/2024, 3:33 PMkpgalligan
08/22/2024, 3:43 PMAbhishek Agarwal
08/22/2024, 3:46 PMkpgalligan
08/22/2024, 4:42 PM0.0.2
. This new flow has to do something "weird" to get artifacts into GitHub releases. It creates the release, uploads the file, then updates the tag for that release. I'm not sure what's going on with this one, but I'm curious if a completely new release would work. I'm thinking maybe there's something going on with a "first one" in your repo for some reason.
(The logs look fine. Nothing failed)Abhishek Agarwal
08/22/2024, 4:47 PMAbhishek Agarwal
08/22/2024, 4:55 PMkpgalligan
08/22/2024, 5:03 PMAbhishek Agarwal
08/22/2024, 5:03 PMkpgalligan
08/22/2024, 5:04 PMAlso when I am reverting back to my previous commit , it just works fineYou're reverting
main
in the KMP repo back to the prior commit (force-push or applying the changes in reverse?), and that "works". Define "works". I feel like 0.0.1
was the first release, and that wasn't working.Abhishek Agarwal
08/22/2024, 5:08 PM