
Bootstraps a library project capable of generating the Fibonacci sequence. Includes basic setup for deployment to Maven Central, with GitHub Actions integration and platform-specific tests.
It is 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.
Note that no other actions or tools usually required for the library development are set up, such as [tracking of backwards compatibility] (https://kotlinlang.org/docs/jvm-api-guidelines-backward-compatibility.html#tools-designed-to-enforce-backward-compatibility), explicit API mode, licensing, contribution guideline, code of conduct and others.
settings.gradle.kts
groupId and version
android section
At this stage, you have everything set to work with Kotlin Multiplatform. The project should be buildable (but you might need to provide actual starting values for the platforms you need).
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 behaviour as you wish by modifying matrix and the Gradle build command
The most part of the job is already automated for you. However, deployment to Maven Central requires some manual work from your side.
gpg --gen-key, use the same email address you used to sign up to the Sonatype JiraD89FAAEB4CECAFD199A2F5E612C6F735F7A9A519
gpg --send-keys --keyserver keyserver.ubuntu.com "<your key id>"gh commandgh secret set OSSRH_GPG_SECRET_KEY -a actions --body "$(gpg --export-secret-key --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>"Settings → Secrets and Variables → Actions, same variables as in 1.module.publication.gradle.kts
deploy.yml
Run Workflow
releaseSonatypeStagingRepository to deploy.yml after this line. This way artifacts will be published to central automatically when tests pass.It is 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.
Note that no other actions or tools usually required for the library development are set up, such as [tracking of backwards compatibility] (https://kotlinlang.org/docs/jvm-api-guidelines-backward-compatibility.html#tools-designed-to-enforce-backward-compatibility), explicit API mode, licensing, contribution guideline, code of conduct and others.
settings.gradle.kts
groupId and version
android section
At this stage, you have everything set to work with Kotlin Multiplatform. The project should be buildable (but you might need to provide actual starting values for the platforms you need).
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 behaviour as you wish by modifying matrix and the Gradle build command
The most part of the job is already automated for you. However, deployment to Maven Central requires some manual work from your side.
gpg --gen-key, use the same email address you used to sign up to the Sonatype JiraD89FAAEB4CECAFD199A2F5E612C6F735F7A9A519
gpg --send-keys --keyserver keyserver.ubuntu.com "<your key id>"gh commandgh secret set OSSRH_GPG_SECRET_KEY -a actions --body "$(gpg --export-secret-key --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>"Settings → Secrets and Variables → Actions, same variables as in 1.module.publication.gradle.kts
deploy.yml
Run Workflow
releaseSonatypeStagingRepository to deploy.yml after this line. This way artifacts will be published to central automatically when tests pass.