terrakok / dummylib-multiplatform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiplatform library template

What is it?

It's the barebones library project intended to quickly bootstrap a Kotlin Multiplatform library, that is deployable to Maven Central.

It has only one function: generate the Fibonacci sequence starting from platform-provided numbers. Also it has a test for each platform just to be sure that tests run.

Almost all links will work correctly in your own repository

How do I build it?

    1. If you need the Android support update namespace there too
    2. If you don't need an Android support delete the android section

At this stage you have everything setup to work with Kotlin Multiplatform the project should be buildable (but you might need to provide actual starting values for platforms you need).

How do I make it build on GitHub Actions?

To make it work on GitHub actions you need to update the matrix section in gradle.yml. If you didn't change platforms in build.gradle.kts you don't need to touch anything. But still read it to understand how it works.

Also, currently it only runs tests, but you can change this behavior as you wish by modifying matrix and the Gradle build command

How do I deploy it to Maven Central?

The most part of the job is already automated for you. However, deployment to Maven Central requires some manual work from your side.

    • You will have to prove that you own your desired namespace
    • Create a GPG key with gpg --gen-key, use the same email address you used to sign up to the Sonatype Jira
    • Find your key id in output of the previous command looking like <your key id>
    • Upload your key to a keyserver, for example
    gpg --send-keys --keyserver keyserver.ubuntu.com "<your key id>"
    • Now you should create secrets available to your GitHub Actions
    1. via gh command
    gh secret set OSSRH_GPG_SECRET_KEY -a actions --body "$(gpg --export --armor "<your key id>")"
    gh secret set OSSRH_GPG_SECRET_KEY_ID -a actions --body "<your key id>"
    gh secret set OSSRH_GPG_SECRET_KEY_PASSWORD -a actions --body "<your key password>"
    gh secret set OSSRH_PASSWORD -a actions --body "<your sonatype account password>"
    gh secret set OSSRH_USERNAME -a actions --body "<your sonatype account username>"
    1. Or via interface in SettingsSecrets and VariablesActions same variables as in 1.
    • Call deployment manually when ready in ActionsRun Workflow
    • When you see in your account on https://oss.sonatype.org that everything is fine you can release your staging repositories and add target releaseSonatypeStagingRepository to deploy.yml after this line. This way artifacts will be published to central automatically when tests pass.



Language:Kotlin 100.0%