Skip to content

Commit 3c2f9a9

Browse files
author
Lucas Mathis
committed
ci: add additional logs and info for publish step
1 parent a990ba9 commit 3c2f9a9

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,13 @@ test_examples_manual:
211211
- build_scheduled
212212
- build_manual
213213
script:
214-
- ./gradlew publish
214+
- echo "=== Publishing to Maven Central ==="
215+
- echo "Runner node $(hostname)"
216+
- echo ""
217+
- echo "Step 1/2 Publishing artifacts to staging repository..."
218+
- ./gradlew publish --info
219+
- echo ""
220+
- echo "Step 2/2 Triggering deployment from same IP..."
215221
# Trigger deployment from same IP to ensure Sonatype can find the staging repository
216222
- ./gradlew triggerDeployment
217223

deepl-java/build.gradle.kts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ tasks.register("triggerDeployment") {
135135
val namespace = "com.deepl.api"
136136
val url = "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$namespace?publishing_type=automatic"
137137

138+
println("Triggering deployment for namespace: $namespace")
139+
println("Endpoint: $url")
140+
138141
val credentials = "$mavenUploadUsername:$mavenUploadPassword"
139142
val encodedCredentials = Base64.getEncoder().encodeToString(credentials.toByteArray())
140143

@@ -148,15 +151,19 @@ tasks.register("triggerDeployment") {
148151
val response = if (responseCode == 200) {
149152
connection.inputStream.bufferedReader().readText()
150153
} else {
151-
connection.errorStream.bufferedReader().readText()
154+
connection.errorStream?.bufferedReader()?.readText() ?: "No error response"
152155
}
153156

154-
println(response)
155-
println("HTTP Status: $responseCode")
157+
println("Response code: $responseCode")
158+
if (response.isNotBlank()) {
159+
println("Response body: $response")
160+
}
156161

157162
if (responseCode != 200) {
158-
throw GradleException("Failed to trigger deployment: $responseCode - $response")
163+
throw GradleException("Failed to trigger deployment: HTTP $responseCode - $response")
159164
}
165+
166+
println("Deployment triggered successfully")
160167
}
161168
}
162169

0 commit comments

Comments
 (0)