Skip to content

Commit 90d54c4

Browse files
committed
move nexus username/password up to top to prevent null
1 parent 63ecfe1 commit 90d54c4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ env:
1616
SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
1717
SPOTIFY_TOKEN_STRING: ${{ github.event.inputs.spotify_test_client_token }}
1818
SPOTIFY_REDIRECT_URI: ${{ github.event.inputs.spotify_test_redirect_uri }}
19-
ORG_GRADLE_PROJECT_NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
20-
ORG_GRADLE_PROJECT_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
19+
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
20+
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
2121
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
2222
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
2323
SPOTIFY_API_PUBLISH_VERSION: ${{ github.event.inputs.release_version }}

build.gradle.kts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ buildscript {
3636
// --- spotify-web-api-kotlin info ---
3737
val libraryVersion: String = System.getenv("SPOTIFY_API_PUBLISH_VERSION") ?: "0.0.0.SNAPSHOT"
3838

39+
// Publishing credentials (environment variable)
40+
val nexusUsername: String? = System.getenv("NEXUS_USERNAME")
41+
val nexusPassword: String? = System.getenv("NEXUS_PASSWORD")
42+
3943
group = "com.adamratzman"
4044
version = libraryVersion
4145

@@ -293,6 +297,10 @@ kotlin {
293297
all { languageSettings.optIn("kotlin.RequiresOptIn") }
294298
}
295299
}
300+
301+
publishing {
302+
registerPublishing()
303+
}
296304
}
297305

298306
publishing {
@@ -389,11 +397,6 @@ fun MavenPublication.setupPom(publicationName: String) {
389397

390398
// --- Publishing ---
391399

392-
// Publishing credentials (environment variable)
393-
val nexusUsername: String? = System.getenv("NEXUS_USERNAME")
394-
val nexusPassword: String? = System.getenv("NEXUS_PASSWORD")
395-
396-
397400
fun PublishingExtension.registerPublishing() {
398401
publications {
399402
val kotlinMultiplatform by getting(MavenPublication::class) {
@@ -413,6 +416,7 @@ fun PublishingExtension.registerPublishing() {
413416
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
414417

415418
credentials {
419+
println("username ${nexusUsername}")
416420
username = nexusUsername
417421
password = nexusPassword
418422
}

0 commit comments

Comments
 (0)