Skip to content

Commit 82e7037

Browse files
committed
build: use env vars for publishing credentials
1 parent 23d1531 commit 82e7037

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

gradle/publishing.gradle

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ publishing {
7878
repositories {
7979
maven {
8080
credentials {
81-
username = findProperty('artifactoryPublishUsername') ?: ''
82-
password = findProperty('artifactoryPublishPassword') ?: ''
81+
username = System.getenv('MAVEN_PUBLISH_USERNAME')
82+
password = System.getenv('MAVEN_PUBLISH_PASSWORD')
8383
}
84-
url = uri('https://repo.grails.org/grails/plugins3-snapshots-local')
84+
url = uri(System.getenv('MAVEN_PUBLISH_URL') ?: '')
8585
}
8686
}
8787
}
@@ -100,15 +100,12 @@ afterEvaluate {
100100

101101
if (isReleaseVersion) {
102102
nexusPublishing {
103-
String sonatypeUsername = findProperty('sonatypeUsername') ?: ''
104-
String sonatypePassword = findProperty('sonatypePassword') ?: ''
105-
String sonatypeStagingProfileId = findProperty('sonatypeStagingProfileId') ?: ''
106103
repositories {
107104
sonatype {
108-
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
109-
username = sonatypeUsername
110-
password = sonatypePassword
111-
stagingProfileId = sonatypeStagingProfileId
105+
nexusUrl = uri(System.getenv('NEXUS_PUBLISH_URL') ?: '')
106+
username = System.getenv('NEXUS_PUBLISH_USERNAME')
107+
password = System.getenv('NEXUS_PUBLISH_PASSWORD')
108+
stagingProfileId = System.getenv('NEXUS_PUBLISH_STAGING_PROFILE_ID')
112109
}
113110
}
114111
}

0 commit comments

Comments
 (0)