Skip to content

Migrate from OSSRH to Sonatype Central publishing #915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gmethvin
Copy link
Member

@gmethvin gmethvin commented Jun 24, 2025

🔹 Jira Ticket(s) if any

N/A

✏️ Description

Migrates Android SDK publishing from legacy OSSRH to the new Sonatype Central publishing system using the NMCP plugin. This includes:

  • Updated GitHub Actions workflow to use Sonatype Central authentication
  • Configured NMCP plugin for automatic publishing
  • Added GPG signing configuration for CI
  • Simplified publishing tasks by removing legacy uploadArchives wrapper

The migration maintains backward compatibility while modernizing the publishing infrastructure.

@gmethvin gmethvin force-pushed the sonatype-publish branch 3 times, most recently from 1f75ce6 to 893fd68 Compare June 24, 2025 02:33
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Will try next release with this publish method. Also hoping the initial wiring of passing library version from project level to module level works all good!

@gmethvin gmethvin force-pushed the sonatype-publish branch 5 times, most recently from 6e20733 to 633e1f7 Compare June 24, 2025 06:07
@Ayyanchira Ayyanchira requested a review from Copilot June 24, 2025 06:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the Android SDK publishing pipeline by migrating from the legacy OSSRH plugin to Sonatype Central via the NMCP Gradle plugin, updating CI steps, and cleaning up deprecated logic.

  • Switches maven-push.gradle to use com.gradleup.nmcp with property-based credentials and automatic publishing
  • Always applies the shared publishing script in both iterableapi and iterableapi-ui modules
  • Updates the GitHub Actions workflow to import GPG keys, generate a secret ring, and publish through Sonatype Central

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
maven-push.gradle Replaced manual OSSRH repo setup with NMCP plugin and property lookups
iterableapi/build.gradle Removed conditional guard around apply from: '../maven-push.gradle'
iterableapi-ui/build.gradle Same unconditional apply of publishing script
.github/workflows/publish.yml Renamed workflow, added branch filter, revamped GPG import/publish steps
.editorconfig Added YAML file indentation rules
Comments suppressed due to low confidence (2)

.github/workflows/publish.yml:8

  • GitHub Actions tag filters use glob patterns, not regex. The + quantifier won’t work here. Consider a glob like "[0-9]*.[0-9]*.[0-9]*" or explicit patterns to match version tags.
      - "[0-9]+.[0-9]+.[0-9]+*" # Match version tags like 3.5.13, 3.6.0-beta1, etc.

iterableapi/build.gradle:94

  • [nitpick] Removing the hasProperty("mavenPublishEnabled") guard means the publishing script always loads, which may break local or test builds when credentials are missing. Consider reintroducing a feature flag or graceful no-op handling.
apply from: '../maven-push.gradle'

@Ayyanchira Ayyanchira self-requested a review June 25, 2025 03:02
cache: gradle

- name: Import GPG Key
- name: Import GPG Key and Create Secring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is helpful 👍🏼


- name: Build
run: ./gradlew clean build
- name: Build and Publish to Sonatype Central
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well and clearly named 👍🏼

@@ -16,50 +16,42 @@

apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.gradleup.nmcp'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, so existing maven-push injection will still work as is with now new plugin. 👌🏼

@gmethvin gmethvin force-pushed the sonatype-publish branch 2 times, most recently from 8fcc497 to 46985c3 Compare June 25, 2025 08:12
- Switch to gradleup/nmcp plugin for automatic publication
- Update GitHub Actions to use SONATYPE_USERNAME/SONATYPE_PASSWORD
- Remove manual repository configuration and staging steps
- Configure modern GPG signing using global iterable secrets
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.

2 participants