File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed
Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 2727 java-version : ' 8'
2828 - name : Build with Gradle
2929 env :
30- sonatypeUsername : ${{ secrets.OSSRH_USERNAME }}
31- sonatypePassword : ${{ secrets.OSSRH_PASSWORD }}
30+ centralAuthHeaderName : ${{ secrets.CENTRAL_AUTH_TOKEN }}
3231 run : ./gradlew build publish
3332 - uses : actions/upload-artifact@v4
3433 with :
Original file line number Diff line number Diff line change @@ -378,26 +378,33 @@ artifacts {
378378 add(" apiArchives" , tasks[" deobfApiJar" ])
379379}
380380
381+ repositories {
382+ maven {
383+ name = " centralManualTesting"
384+ url " "
385+
386+ }
387+ mavenCentral()
388+ }
389+
381390publishing {
382391 repositories {
383392 maven {
384- name = " Sonatype "
393+ name = " central "
385394
386- val user = (project.properties[" sonatypeUsername" ] ? : System .getenv(" sonatypeUsername" )) as String?
387- val pass = (project.properties[" sonatypePassword" ] ? : System .getenv(" sonatypePassword" )) as String?
388- val local = user == null || pass == null
395+ val local = properties[" centralAuthHeaderName" ] == null
389396 if (local) {
390397 logger.warn(" Username or password not set, publishing to local repository in build/mvnrepo/" )
391398 }
392399 val localUrl = " $buildDir /mvnrepo"
393- val releasesRepoUrl = " https://oss .sonatype.org/service/local/staging/deploy/maven2 "
394- val snapshotsRepoUrl = " https://oss .sonatype.org/content/repositories/snapshots "
400+ val releasesRepoUrl = " https://central .sonatype.com/api/v1/publisher/deployments/download/ "
401+ val snapshotsRepoUrl = " https://central .sonatype.com/api/v1/publisher/deployments/download/ "
395402
396403 setUrl(if (local) localUrl else if (doRelease.toBoolean()) releasesRepoUrl else snapshotsRepoUrl)
397404 if (! local) {
398- credentials {
399- username = user
400- password = pass
405+ credentials( HttpHeaderCredentials :: class )
406+ authentication {
407+ create< HttpHeaderAuthentication >( " header " )
401408 }
402409 }
403410 }
You can’t perform that action at this time.
0 commit comments