File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 2929 env :
3030 ORG_GRADLE_PROJECT_OSSRH_USERNAME : Bearer ${{ secrets.OSSRH_USERNAME }}
3131 ORG_GRADLE_PROJECT_OSSRH_PASSWORD : Bearer ${{ secrets.OSSRH_PASSWORD }}
32+ ORG_GRADLE_PROJECT_centralAuthHeaderName : Authorization
33+ ORG_GRADLE_PROJECT_centralAuthHeaderValue : Bearer ${{ secrets.CENTRAL_AUTH_TOKEN }}
3234 run : ./gradlew build publish
3335 - uses : actions/upload-artifact@v4
3436 with :
Original file line number Diff line number Diff line change @@ -241,13 +241,19 @@ publishing {
241241
242242 setUrl(if (local) localUrl else if (doRelease.toBoolean()) releasesRepoUrl else snapshotsRepoUrl)
243243 if (! local) {
244- credentials {
245- username = ossrhMavenUsername
246- password = ossrhMavenPassword
244+ if (doRelease.toBoolean()) {
245+ credentials {
246+ username = ossrhMavenUsername
247+ password = ossrhMavenPassword
248+ }
249+ } else {
250+ credentials(HttpHeaderCredentials ::class )
251+ authentication {
252+ create<HttpHeaderAuthentication >(" header" )
253+ }
247254 }
248255 }
249256 }
250-
251257 // only register maven.daporkchop.net repository if these environment variables are set
252258 val daporkchopMavenUsername = (project.properties[" daporkchopMavenUsername" ] ? : System .getenv(" daporkchopMavenUsername" )) as String?
253259 val daporkchopMavenPassword = (project.properties[" daporkchopMavenPassword" ] ? : System .getenv(" daporkchopMavenPassword" )) as String?
Original file line number Diff line number Diff line change @@ -414,9 +414,16 @@ publishing {
414414
415415 setUrl(if (local) localUrl else if (doRelease.toBoolean()) releasesRepoUrl else snapshotsRepoUrl)
416416 if (! local) {
417- credentials {
418- username = ossrhMavenUsername
419- password = ossrhMavenPassword
417+ if (doRelease.toBoolean()) {
418+ credentials {
419+ username = ossrhMavenUsername
420+ password = ossrhMavenPassword
421+ }
422+ } else {
423+ credentials(HttpHeaderCredentials ::class )
424+ authentication {
425+ create<HttpHeaderAuthentication >(" header" )
426+ }
420427 }
421428 }
422429 }
You can’t perform that action at this time.
0 commit comments