diff --git a/RELEASING.md b/RELEASING.md index 5b1bf523..f7a32674 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -16,7 +16,28 @@ Releasing 1. Click on Tags 2. Find your new tag and select "Create Release" from the context menu. 3. Auto-generate and edit release notes as necessary. -2. `./gradlew clean publish --no-daemon --no-parallel && ./gradlew closeAndReleaseRepository` +2. Publish to Maven Central via Sonatype Central Portal: + ```bash + ./gradlew clean :plugin:publishToSonatype closeSonatypeStagingRepository --no-daemon --no-parallel + ``` + This will upload the artifacts to a staging repository and close it for review. + +3. Review and release the deployment: + - Go to https://central.sonatype.com/publishing + - Review the staged deployment + - Click "Publish" to release to Maven Central + + **Alternative:** To publish automatically without manual review: + ```bash + ./gradlew clean :plugin:publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon --no-parallel + ``` + +**Note:** Publishing requires Central Portal User Tokens in `~/.gradle/gradle.properties`: +```properties +mavenCentralUsername= +mavenCentralPassword= +``` +Generate User Tokens at: https://central.sonatype.com/account ## Prepare for Next Release diff --git a/build.gradle b/build.gradle index 2ef7c873..6a645a9d 100644 --- a/build.gradle +++ b/build.gradle @@ -13,12 +13,28 @@ buildscript { classpath deps.build.sqlDelightPlugin classpath deps.build.shadowJar classpath deps.build.versionsPlugin + classpath deps.build.gradleNexusPublish } configurations.all { exclude group:"com.android.tools.build", module: "transform-api" } } +apply plugin: "io.github.gradle-nexus.publish-plugin" + +// Configure Nexus publishing for automatic repository closing +nexusPublishing { + packageGroup = "com.uber" + repositories { + sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + username.set(providers.gradleProperty('mavenCentralUsername').forUseAtConfigurationTime().orElse('')) + password.set(providers.gradleProperty('mavenCentralPassword').forUseAtConfigurationTime().orElse('')) + } + } +} + allprojects { task allDeps(type: DependencyReportTask) {} } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index f0b8963d..4e3dc22c 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -7,6 +7,7 @@ buildscript { } dependencies { classpath deps.build.gradleMavenPublish + classpath deps.build.gradleNexusPublish classpath deps.build.errorpronePlugin classpath deps.build.rockerPlugin } diff --git a/buildSrc/gradle.properties b/buildSrc/gradle.properties index ef77d666..efbdb18b 100644 --- a/buildSrc/gradle.properties +++ b/buildSrc/gradle.properties @@ -15,5 +15,4 @@ POM_NAME=okbuck POM_ARTIFACT_ID=okbuck POM_PACKAGING=jar -SONATYPE_HOST=DEFAULT RELEASE_SIGNING_ENABLED=true diff --git a/dependencies.gradle b/dependencies.gradle index ffaf7a7d..36703e98 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -39,6 +39,7 @@ def build = [ androidPluginApi : "com.android.tools.build:gradle-api:${versions.androidPlugin}", bcprov : "org.bouncycastle:bcprov-jdk15on:1.60", gradleMavenPublish: "com.vanniktech:gradle-maven-publish-plugin:0.18.0", + gradleNexusPublish: "io.github.gradle-nexus:publish-plugin:1.3.0", butterKnifePlugin: "com.jakewharton:butterknife-gradle-plugin:${versions.butterKnife}", commonsCompress : "org.apache.commons:commons-compress:1.18", commonsIo : "commons-io:commons-io:2.8.0",