-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting up maven publishing and release process #113
Conversation
I see some MacOS stuff in there. |
Well, we cannot build Mac-related stuff on the CI, but the release will be triggered only from my machines (as I have the credentials for Sonatype), and my machines are mac, so we can publish Mac-related stuff. I think we can skip it if necessary |
By disabling JS and Native, I could publish on Maven Central the JVM module. Perhaps we can start with that and add an issue to fix at least the JS publication. |
hmm, it seems strange that klib wouldn't be supported, that's the standard publishing format for Kotlin Multiplatform. okio is currently publishing klibs on maven central: https://repo1.maven.org/maven2/com/squareup/okio/okio-macosx64/3.6.0/ |
Mmm, yes, they do not seem to be publishing jars (besides the metadata jar). |
There is a chapter in the Multiplatform docs: https://kotlinlang.org/docs/multiplatform-publish-lib.html
And then:
|
I see you also added Dokka. IMO worth doing that in another PR if it's not strictly necessary here. |
I feel like configuring everything at the root should be enough, we shouldn't do anything with child modules. |
We need to produce a javadoc jar to publish on Maven Central, and I am not sure we can do that without using Dokka, as we do not have java code |
Looks like you're right. I've found this README for a publishing plugin aimed at being compatible with Kotlin Multiplatform, which has some explanation on publishing. https://github.com/DanySK/publish-on-central/blob/master/README.md |
That plugin does indeed wrap Dokka. Might be a good pick to investigate. Maybe tagging the author might also help if we're stuck 👀 |
At least locally the problem seems to be solved by not publishing all the publications of the runtime but only the JVM one. I suspect otherwise a JAR from KMP replaces the "normal" JAR. By doing so I get a JAR that is ~400K instead of ~40K and I can have the example project (a JVM project and not a KMP project) works. I will verify that works only on Maven Central |
Ok, that was probably due to a line where I overridden the artifact name. Removing that line I can publish to Maven local and those publications work |
I'd give that Publish to Central plugin a try, because it seems maintaining the publication code will be a nightmare (if it's already a nightmare coming up with a working solution). |
I think that right now, we can get it working if we disable both native and JS when publishing on Maven Central. I am not even sure that JS users actually need the code on Maven Central. Maybe it is needed for KMP projects? Regarding the Publish to Central plugin it states:
I am not sure what that means. Maybe we then need to do something manually? If so, what? |
Let's see if on the Kotlin Slack they can give advice: https://kotlinlang.slack.com/archives/C3PQML5NU/p1702028532744219 |
Unfortunately even JS consumers need a published package. Regarding the plugin, I agree the explanation is a bit unclear. However there are sample projects under: https://github.com/DanySK/publish-on-central/tree/master?tab=readme-ov-file#kotlin-multiplatform-1 The template one has a seemingly straightforward configuration. |
…AllPublicationsToMavenCentralRepository
I am trying out a similar plugin (com.vanniktech.maven.publish) and it seems to work... I just tried publishing version 0.1.0-RC5 with it. We could see if that works once it propagate to Maven Central The plugin was suggested in some discussion on the Kotlin Slack group |
...and this seems to work! I can run I also tested the version I released (0.1.0-RC5) and it works in the examples project |
Oh nice! I've seen that plugin seems to be quite popular. I'll give a look at all the PR changes as soon as I'm back at home. |
I think we covered all the issues raised, so I am merging this. If there is anything else pending I can still cover it in a follow up ticket |
Fix #109
To do: