sbt / sbt-ci-release

sbt plugin to automate Sonatype releases from GitHub Actions
Apache License 2.0
286 stars 76 forks source link

Support for Sonatype Portal Publisher API #333

Open d10xa opened 1 week ago

d10xa commented 1 week ago

I’m encountering a 404: Not Found error when using the sbt-ci-release plugin after switching to the new Sonatype Portal Publisher API. The issue seems to be related to the URL used by the plugin, which points to the legacy API instead of the new one.

error:

2024-11-17 17:46:40.288Z error [Sonatype] 
wvlet.airframe.http.HttpClientException: [404: Not Found] Request failed: <!DOCTYPE html>...
    at xerial.sbt.sonatype.SonatypeClient.stagingRepositoryProfiles(SonatypeClient.scala:82)
    at xerial.sbt.sonatype.SonatypeService.stagingRepositoryProfiles(SonatypeService.scala:116)
    ...

Full logs: GitHub Actions logs

Relevant Configuration:

•   Plugin version: sbt-ci-release 3.11.2
•   sonatypeCredentialHost is set to sonatypeCentralHost.

Could you please provide guidance on how to configure the sbt-ci-release plugin to work with the new Sonatype Portal Publisher API? Specifically, how should the publishTo and sonatypeCredentialHost settings be adjusted for the updated API endpoint (https://central.sonatype.com/api/v1/publish)? Any additional examples or documentation would be greatly appreciated.

Andrapyre commented 1 week ago

@d10xa , your version of sbt-ci-release is too old here. Working support for publishing to Sonatype Central only shipped with 1.7. Here's an example of one of the first repos that we got working: https://github.com/PerformanceIMMO/pg-event-store/blob/main/build.sbt