Skip to content

prepare Maven Central-compatible Kotlin publication#269

Open
Guardiola31337 wants to merge 1 commit into
mainfrom
feature/setup-kotlin-maven-central
Open

prepare Maven Central-compatible Kotlin publication#269
Guardiola31337 wants to merge 1 commit into
mainfrom
feature/setup-kotlin-maven-central

Conversation

@Guardiola31337
Copy link
Copy Markdown
Contributor

@Guardiola31337 Guardiola31337 commented May 22, 2026

Description

  • keep the existing Kotlin GitHub Packages publishing path active
  • prepare the Kotlin bindings artifact as a Maven Central-compatible Maven publication with coordinates com.worldcoin:idkit
  • add local Maven publishing via publishToMavenLocal
  • make Maven Central upload/signing available only through an explicit local Gradle opt-in, so current GitHub release workflows do not require Central credentials yet
  • lower the Android library/sample minSdk from 26 to 23 so WLD Android devDebug can consume the artifact

Changes

  • keep .github/workflows/publish-kotlin.yml unchanged relative to main; it still publishes Kotlin releases to GitHub Packages
  • keep :bindings:publish targeting GitHub Packages by default
  • add Vanniktech Maven publish metadata for the Android release publication
  • gate Maven Central upload/signing tasks behind -Pidkit.publish.mavenCentral=true
  • add an empty -javadoc.jar artifact so the publication shape is compatible with Maven Central without running Android/Kotlin Javadoc generation
  • add verifyKotlinNativeLibraries and wire it into Maven publish tasks so publishing fails before artifact creation if expected native .so files are missing
  • add CI validation that publishes to mavenLocal(), checks the generated artifact files/POM/AAR native libraries, and dry-runs the Maven Central task graph without credentials
  • update the Kotlin README to document GitHub Packages, mavenLocal(), and explicit local Maven Central publish commands

Publishing behavior

Default release behavior remains GitHub Packages:

./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin :bindings:publish

Without -Pidkit.publish.mavenCentral=true, Gradle configures GitHub Packages and Maven local tasks, but does not configure Maven Central upload or signing tasks.

Local Maven publish:

./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin :bindings:publishToMavenLocal

Manual Maven Central publish from a developer machine with Central Portal credentials and signing configured in ~/.gradle/gradle.properties:

./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin \
  -Pidkit.publish.mavenCentral=true \
  :bindings:publishToMavenCentral

To upload and release in one command:

./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin \
  -Pidkit.publish.mavenCentral=true \
  :bindings:publishAndReleaseToMavenCentral

Testing

  • ./gradlew :app:assembleDebug from kotlin/Examples/IDKitSampleApp
  • ./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin :bindings:tasks --all exposes GitHub Packages and local Maven publish tasks, not Central/signing tasks
  • ./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin -Pidkit.publish.mavenCentral=true :bindings:tasks --all exposes publishToMavenCentral, publishAndReleaseToMavenCentral, and signMavenPublication
  • ./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin :bindings:publish --dry-run targets publishMavenPublicationToGitHubPackagesRepository and includes verifyKotlinNativeLibraries
  • ./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin :bindings:publishToMavenLocal --dry-run
  • ./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin -Pidkit.publish.mavenCentral=true :bindings:publishToMavenCentral --dry-run
  • ./kotlin/Examples/IDKitSampleApp/gradlew -p kotlin :bindings:verifyKotlinNativeLibraries fails locally when generated jniLibs are absent, with the expected missing-library message
  • git diff --check

Not included yet

  • The automated release workflow does not upload Kotlin artifacts to Maven Central yet.
  • Maven Central GitHub Actions release wiring should be added once Central credentials/signing setup is available in GitHub secrets and the end-to-end release path has been tested.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
idkit-js-example Ready Ready Preview, Comment May 28, 2026 2:25pm

Request Review

@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from b002ef4 to f6fc2a0 Compare May 22, 2026 18:35
@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from f6fc2a0 to 922152c Compare May 22, 2026 18:41
@Guardiola31337 Guardiola31337 self-assigned this May 22, 2026
@Guardiola31337 Guardiola31337 marked this pull request as ready for review May 22, 2026 20:06
@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from 922152c to f25cb78 Compare May 22, 2026 20:57
@Guardiola31337 Guardiola31337 changed the title setup Kotlin Maven Central publishing prepare local Kotlin Maven publication May 22, 2026
@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from f25cb78 to 381260e Compare May 22, 2026 21:02
@Guardiola31337 Guardiola31337 changed the title prepare local Kotlin Maven publication prepare Maven Central-compatible local Kotlin publication May 22, 2026
@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from 381260e to ca6726c Compare May 22, 2026 21:13
@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from ca6726c to 65cc36f Compare May 23, 2026 00:10
@Guardiola31337 Guardiola31337 changed the title prepare Maven Central-compatible local Kotlin publication prepare Maven Central-compatible Kotlin publication May 23, 2026
@Guardiola31337 Guardiola31337 force-pushed the feature/setup-kotlin-maven-central branch from 65cc36f to 1dfb4e9 Compare May 23, 2026 00:16
@Takaros999
Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Guardiola31337 Guardiola31337 requested a review from Grimald May 25, 2026 19:21
@Guardiola31337
Copy link
Copy Markdown
Contributor Author

@Grimald please take a look when you have a chance 🙏

@Grimald
Copy link
Copy Markdown
Contributor

Grimald commented May 26, 2026

@Guardiola31337 PR looks good and is merge-ready.
Optional follow-ups to harden Kotlin publishing:

  1. add CI validation for the Maven Central path (publishToMavenLocal, artifact shape checks, etc.),
  2. add a publish preflight that fails fast if required native .so artifacts are missing,
  3. centralize the com.vanniktech.maven.publish plugin version in root plugin management/version catalog.

But I'm not a codeowner =((

Grimald
Grimald previously approved these changes May 26, 2026
@Guardiola31337
Copy link
Copy Markdown
Contributor Author

Thanks for the review. Addressed the two hardening items that make sense in this PR:

  • Added credentials-free CI validation for the Kotlin Maven publication: :bindings:publishToMavenLocal, generated artifact/POM checks, AAR native library checks for all expected ABIs, and a Maven Central dry-run with -Pidkit.publish.mavenCentral=true.
  • Added a Gradle preflight task, verifyKotlinNativeLibraries, wired into Maven publish tasks so publishing fails fast if any expected libidkit.so is missing.

Kept actual Maven Central upload out of the release workflow for now because Central credentials/signing are not available in GitHub secrets yet. Leaving plugin-version centralization as a follow-up since :bindings is resolved from both the Kotlin root and the sample app root.

@Guardiola31337
Copy link
Copy Markdown
Contributor Author

@Takaros999 fixed the conflicts, ready for another round of 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants