Skip to content

ANDROID-16206 Migrate Sonatype publishing to Central Portal#51

Merged
haynlo merged 2 commits intomainfrom
ANDROID-16206/migrate_sonatype
Jun 19, 2025
Merged

ANDROID-16206 Migrate Sonatype publishing to Central Portal#51
haynlo merged 2 commits intomainfrom
ANDROID-16206/migrate_sonatype

Conversation

@haynlo
Copy link
Contributor

@haynlo haynlo commented Jun 18, 2025

🎟️ Jira ticket

ANDROID-16206

🥅 What's the goal?

Migrate Sonatype publishing to Central Portal following the migration guide.

🚧 How do we do it?

  • Update the Gradle Nexus Publish Plugin to version 2.0.0, which supports Central Portal.
  • Add the new nexus URLs and snapshot repository URLs under the sonatype block.
  • Replace closeAndReleaseStagingRepository with closeAndReleaseStagingRepositories, as this is required by the new plugin version for compatibility with Central Portal.

ℹ️ Not related (poyake): Remove this declaration android.r8.failOnMissingClasses=true since it is ignored and true by default in AGP >= 8.0 (current is 8.2.2)

📘 Documentation changes?

https://confluence.tid.es/pages/viewpage.action?spaceKey=CTO&title=Migration+from+OSSRH+to+Central+Portal#Updating+Open+Source+Projects

🧪 How can I test this?

Snapshot artifact has been uploaded successfully in Central Portal: 5.0.1.1-SNAPSHOT
https://github.com/Telefonica/tweaks/actions/runs/15728382440
https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/telefonica/tweaks/

kapt.use.worker.api=true

# This will be default on AGP 8.0
android.r8.failOnMissingClasses=true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +9 to +10
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
Copy link
Contributor Author

@haynlo haynlo Jun 18, 2025

Choose a reason for hiding this comment

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

plugins {
id("io.gitlab.arturbosch.detekt").version("1.18.1")
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' apply false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
run: "bash ./gradlew publishReleasePublicationToSonatypeRepository -DLIBRARY_VERSION=${{ github.event.release.tag_name }} publishNoopPublicationToSonatypeRepository -DLIBRARY_VERSION=${{ github.event.release.tag_name }} --max-workers 1 closeAndReleaseStagingRepository"
run: "bash ./gradlew publishReleasePublicationToSonatypeRepository -DLIBRARY_VERSION=${{ github.event.release.tag_name }} publishNoopPublicationToSonatypeRepository -DLIBRARY_VERSION=${{ github.event.release.tag_name }} --max-workers 1 closeAndReleaseStagingRepositories"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@haynlo haynlo requested review from a team, DevPabloGarcia and dagonco and removed request for a team June 18, 2025 10:54
@haynlo haynlo merged commit 1d0a4c1 into main Jun 19, 2025
3 checks passed
@haynlo haynlo deleted the ANDROID-16206/migrate_sonatype branch June 19, 2025 10:44
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