From d21a4be02387a29e08f966863ecbe7a800c66815 Mon Sep 17 00:00:00 2001 From: Tofaa2 Date: Sat, 25 Oct 2025 17:42:36 +0400 Subject: [PATCH] Attempt at central publishing 2 --- README.md | 17 +++++++++++++++++ .../entitylib.library-conventions.gradle.kts | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e894ef..d9cacc7 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,23 @@ class Example { ``` +## Publishing to Maven Central + +EntityLib uses the new Maven Central publishing system via the Central Portal (replacing the deprecated OSSRH). To publish, set up the following GitHub secrets: + +- `OSSRH_USERNAME`: Your Central Portal username (usually your email). +- `OSSRH_PASSWORD`: Your publishing token from the Central Portal. +- `GPG_PRIVATE_KEY`: Your GPG private key (for signing artifacts). +- `GPG_PASSPHRASE`: The passphrase for your GPG key. + +### Setting Up Central Portal Credentials +1. Go to [Central Portal](https://central.sonatype.com/) and log in with your GitHub account. +2. Create a namespace for your group ID (`io.github.tofaa2`). +3. Generate a publishing token from the "Account Settings" > "Publishing Tokens". +4. Use your email as the username and the token as the password. + +Snapshots are automatically published on pushes to the `master` branch. Stable releases are published when a GitHub release is created. + ### TODO: Once this list is complete, i will release a stable version of the library. - [ ] Implement checks for each EntityMeta to make sure the version specific data is correct. diff --git a/buildSrc/src/main/kotlin/entitylib.library-conventions.gradle.kts b/buildSrc/src/main/kotlin/entitylib.library-conventions.gradle.kts index 3fcc198..ed7c18f 100644 --- a/buildSrc/src/main/kotlin/entitylib.library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/entitylib.library-conventions.gradle.kts @@ -86,8 +86,8 @@ publishing { maven { url = uri("https://central.sonatype.com/api/v1/publisher/upload") credentials { - username = System.getenv("CENTRAL_PORTAL_USERNAME") - password = System.getenv("CENTRAL_PORTAL_TOKEN") + username = System.getenv("OSSRH_USERNAME") + password = System.getenv("OSSRH_PASSWORD") } } }