Skip to content

Conversation

@jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Jun 14, 2025

Description

One Line Summary

Migrate publishing from OSSRH to the Central Publisher Portal.

  • There are no changes to those consuming this SDK, only for maintainers to publish.

Details

Added the plugin com.vanniktech.maven.publish to publish to the Central Publisher Portal.

To publish the following command must be used now:

./gradlew publishToMavenCentral --no-configuration-cache \
-PmavenCentralUsername=USER_TOKEN_USERNAME_HERE \
-PmavenCentralPassword=USER_TOKEN_PASSWORD_HERE \
-Psigning.keyId=ID_HERE \
-Psigning.password=PASSWORD_HERE \
-Psigning.secretKeyRingFile=/FULL/PATH/TO/GPG_FILE_HERE

Can switch to publishAndReleaseToMavenCentral once we do a release manually and test end-to-end.

Motivation

OSSRH is shutting down 2025/06/30 so we need to migrate to the Central Portal for publishing.

Scope

Only effects the logic used for publishing and releasing the SDK

Testing

Unit testing

N/A

Manual testing

Tested publishing validates default checks on the Central Portal dashboard:
image

Tested on the OneSignal example project before releasing a version:

  • This only needs to be done if you are making major changes to the release process and want to to end-to-end before making the release public.
  1. Bump version numbers in app/build.gradle

    • Example 5.2.0-beta-04 -> 5.2.0-beta-05
  2. Add deployment repo in top level build.gradle

allprojects {
    repositories {
        maven {
            name = "centralManualTesting"
            url "https://central.sonatype.com/api/v1/publisher/deployment/{DEPLOYMENT_ID_HERE}/download"
            content {
                includeGroup "com.onesignal"
            }
            credentials(HttpHeaderCredentials)
            authentication {
                header(HttpHeaderAuthentication)
            }
        }
       // Keep existing entries
    }
}
  1. Add auth to gradle.properties
centralManualTestingAuthHeaderName=Authorization

// To generate BASE64_VALUE use printf "example_username:example_password" | base64
centralManualTestingAuthHeaderValue=Bearer BASE64_VALUE

The instructions above were extracted from Central Portal testing docs:

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
    • Pre-existing error
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

@jkasten2 jkasten2 added WIP Work In Progress and removed WIP Work In Progress labels Jun 14, 2025
Copy link
Contributor

@jinliu9508 jinliu9508 left a comment

Choose a reason for hiding this comment

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

Approved. There is a failing test in the runner but can be resolved after a rebase.

jkasten2 added 2 commits June 18, 2025 13:28
We will need these as variables so they can be shared with future
changes we are going to make to maven-push.gradle.

"apply from:" doesn't have an option to share the classpath.
OSSRH is shutting down soon so we need to migrate to the Central Portal
for publishing.
* There are no changes to those consuming this SDK, only for mainliners
to publish.

Add the "plugin com.vanniktech.maven.publish" plugin to publish to
the Central Portal.

To publish the following command must be used now:
./gradlew publishToMavenCentral --no-configuration-cache \
-PmavenCentralUsername=USER_TOKEN_USERNAME_HERE \
-PmavenCentralPassword=USER_TOKEN_PASSWORD_HERE \
-Psigning.keyId=ID_HERE \
-Psigning.password=PASSWORD_HERE \
-Psigning.secretKeyRingFile=/FULL/PATH/TO/GPG_FILE_HERE

Can switch to publishAndReleaseToMavenCentral once we do a release
manually and test end-to-end.
@jkasten2 jkasten2 force-pushed the publish/5.2_migrate_to_central_portal branch from 431b44b to 4ae6907 Compare June 18, 2025 17:28
@jkasten2
Copy link
Member Author

Approved. There is a failing test in the runner but can be resolved after a rebase.

Thanks, rebased and it is now passing

@jkasten2 jkasten2 merged commit 2a8809c into identity_verification_beta Jun 18, 2025
2 checks passed
@jkasten2 jkasten2 deleted the publish/5.2_migrate_to_central_portal branch June 18, 2025 17:41
@jkasten2 jkasten2 changed the title [5.2.x] Migrate publishing to Central Portal [5.2.x] Migrate publishing to Central Publisher Portal Jun 24, 2025
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