https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

Edoardo Luppi

12/06/2023, 10:31 AM
Is there a Multiplatform publication expert that could give us a couple advices for GitHub Actions + Maven Central? Would be immensely appreciated 😆 https://github.com/Strumenta/antlr-kotlin/pull/107 Targets are JVM, JS and Native (for the enabled native targets, see here)
o

Oleg Yukhnevich

12/06/2023, 11:17 AM
I could take a look if needed in coming days 🙂 Or you can look here for inspiration: • GitHub Actions workflow: https://github.com/whyoleg/cryptography-kotlin/blob/main/.github/workflows/publish-release.yml (everything is published from single macos host - I think, this should work at your side also) • gradle maven publish setup: https://github.com/whyoleg/cryptography-kotlin/blob/main/build-logic/src/main/kotlin/ckbuild.publish.gradle.kts (multiplatform plugin configures most of the things, for JVM plugin there will be needed some additional setup)
e

Edoardo Luppi

12/08/2023, 9:34 AM
Ah damn completely forgot to reply, sorry. We're doing a bunch of tests but it's not easy lol, I didn't expect it to be this complex.
o

Oleg Yukhnevich

12/08/2023, 10:54 AM
feel free to ping with questions if you need some help 🙂
e

Edoardo Luppi

12/08/2023, 10:55 AM
@Oleg Yukhnevich see the last question that was posted on this channel by Federico
He's doing the tests
o

Oleg Yukhnevich

12/08/2023, 10:59 AM
as far as I see in PR, he says that everything
seems work
with custom publish plugin 🙂
e

Edoardo Luppi

12/08/2023, 11:01 AM
Ahh yup you're right, just noticed. I feel like it should work with the built in Maven publish plugin tho. But if that one is known and used in the community then I guess it's ok
o

Oleg Yukhnevich

12/08/2023, 11:04 AM
yeah, this plugin just additionally configures
maven-publish
plugin At my side, I prefer not to use it, as it's rather easy to do it without it As I posted above, for multiplatform, I have single, rather small file with all logic needed for publication. For JVM you need only to create additional publication But, this plugin should also work, and I know a lot of libraries published with it
✔️ 1
e

Edoardo Luppi

12/08/2023, 11:05 AM
Is there a way to test publishing to Central without actually publishing? I don't have an account there and obviously I don't want to publish, but I'd like to experiment too
o

Oleg Yukhnevich

12/08/2023, 11:06 AM
not really there are 2 steps to check if everything is fine: 1. publish to maven local and check that everything works if to add it to dependencies to some artificial project 2. publish to maven central and check that there is no other errors in staging repository regarding signing, uploaded files and so on - so called maven central requirements
e

Edoardo Luppi

12/08/2023, 11:08 AM
So after publish to staging, I can just get rid of everything, it's the same concept as for Git?
o

Oleg Yukhnevich

12/08/2023, 11:10 AM
yeah staging repository on maven central can be closed (releasing version to public) or deleted (remove artifacts) you can also even add
staging
repository to you build script and check, that version uploaded to maven central is working (same as in step 1 above)
e

Edoardo Luppi

12/08/2023, 11:10 AM
Ah, cool! Well thanks for all the clarifications! I'm just too used to publish to private repos lol, never tried Central.
2 Views