Skip to content

Commit 914a9e6

Browse files
rashidelsanowclaude
andcommitted
Pass credentials as Gradle properties instead of env vars
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b6469a9 commit 914a9e6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/publish_maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
# Runs upload, and then closes & releases the repository
3838
- name: Publish to MavenCentral
39-
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --max-workers 1
39+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --max-workers 1 -PossrhUsernameV2=$OSSRH_USERNAME_V2 -PossrhPasswordV2=$OSSRH_PASSWORD_V2
4040
env:
4141
OSSRH_USERNAME_V2: ${{ secrets.OSSRH_USERNAME_V2 }}
4242
OSSRH_PASSWORD_V2: ${{ secrets.OSSRH_PASSWORD_V2 }}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ nexusPublishing {
2828
sonatype {
2929
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
3030
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
31-
username.set(providers.environmentVariable('OSSRH_USERNAME_V2'))
32-
password.set(providers.environmentVariable('OSSRH_PASSWORD_V2'))
31+
username.set(providers.gradleProperty('ossrhUsernameV2'))
32+
password.set(providers.gradleProperty('ossrhPasswordV2'))
3333
}
3434
}
3535
}

0 commit comments

Comments
 (0)