Skip to content

Central Portal Migration #865

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 9 commits into
base: master
Choose a base branch
from

Conversation

jaredmixpanel
Copy link
Collaborator

@jaredmixpanel jaredmixpanel commented Jun 30, 2025

This pull request introduces a comprehensive overhaul of the Maven Central publishing process for the project, transitioning to the new Sonatype Central Portal API and automating key steps. The changes span workflow configuration, documentation updates, and script enhancements to streamline artifact publishing and improve security.

Workflow Enhancements:

  • Added a new GitHub Actions workflow (.github/workflows/publish-maven.yml) to automate publishing to Maven Central, supporting both manual and automatic publishing modes. The workflow includes steps for setting up the environment, building artifacts, and uploading to the Central Portal API.
  • Updated the release workflow (.github/workflows/release.yml) to include a note in the release body about manually releasing deployments from the Maven Central Portal.

Documentation Updates:

  • Expanded CLAUDE.md with detailed instructions on the automated release process, environment variable requirements, and manual upload steps for the new Maven Central Portal. Security recommendations for storing credentials were also added. [1] [2]

Gradle Configuration Changes:

  • Updated gradle.properties to reflect the new OSSRH staging and snapshot repository URLs, and incremented the version to 8.2.1-SNAPSHOT. [1] [2]
  • Enhanced maven.gradle to dynamically select the appropriate repository URL based on the version type (release or snapshot) and added support for the new Portal tokens in the getRepositoryUsername and getRepositoryPassword methods. [1] [2]

Release Script Improvements:

  • Modified release.sh to include an automated upload step to the Maven Central Portal using API tokens. Added error handling for missing credentials and updated messaging to reflect the new release process. [1] [2]

@jaredmixpanel jaredmixpanel requested a review from Copilot July 2, 2025 00:32
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 migrates the Android SDK’s release process to leverage the new Maven Central Portal API, updates related configuration URLs, and adds a dedicated GitHub Actions workflow for Portal publishing.

  • release.sh now automatically uploads artifacts to the Central Portal (with env var checks) and fixes branch‐push and typo errors.
  • maven.gradle consolidates repository URLs into a single block, adds conditional signing for non‐snapshot releases, and supports Portal tokens alongside legacy Sonatype creds.
  • Configuration and documentation updates: bumped VERSION_NAME, updated repository endpoints in gradle.properties, enhanced CLAUDE.md with Portal instructions, added a publish-maven.yml workflow, and annotated the standard release.yml with a manual release reminder.

Reviewed Changes

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

Show a summary per file
File Description
release.sh Added Portal upload steps, credential checks, HTTP‐status handling, and typo fixes.
maven.gradle Unified release/snapshot repos, conditional signing, and Portal token support.
gradle.properties Version bump and updated Maven Central repository endpoints.
CLAUDE.md Expanded release documentation with automated Portal setup and manual upload guide.
.github/workflows/release.yml Noted manual step to promote from Central Portal in GitHub release body.
.github/workflows/publish-maven.yml New workflow for dispatching user‐managed or automatic Portal deployments.
Comments suppressed due to low confidence (3)

.github/workflows/publish-maven.yml:55

  • [nitpick] The workflow exports the secret as CENTRAL_TOKEN, but elsewhere (e.g., in release.sh) it’s referred to as CENTRAL_PORTAL_TOKEN. Align the variable names across scripts for clarity and to avoid confusion.
          CENTRAL_TOKEN: ${{ secrets.CENTRAL_PORTAL_TOKEN }}

CLAUDE.md:135

  • [nitpick] The manual upload instructions here duplicate the curl command in release.sh. Consider linking to or sourcing the script’s block directly to avoid drift if the command needs updates in the future.
4. **Manual Portal Upload** (if automation fails):

gradle.properties:19

  • The SNAPSHOT_REPOSITORY_URL now points to the web UI rather than the artifact repository. The correct endpoint for deploying snapshots is still https://oss.sonatype.org/content/repositories/snapshots/. Please revert or verify the proper REST URL to ensure snapshot publishes continue to work.
SNAPSHOT_REPOSITORY_URL=https://central.sonatype.com/repository/maven-snapshots/

@@ -0,0 +1,128 @@
name: Publish to Maven Central
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has not yet been tested. We will still release via the release.sh script for now, but this is a start.

@jaredmixpanel jaredmixpanel marked this pull request as ready for review July 2, 2025 21:55
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.

1 participant