Skip to content

Commit 6a5bf06

Browse files
authored
update release process to publishPlugin after sonatype publish (#704)
Recent RC releases were failing to publish sonatype but were successfully publish Gradle plugin. Attempting to publish plugin only after successful sonatype publish by explicitly specifying tasks to execute. Unfortunately cannot easily configure the order using `build.gradle.kts` as `finalizedBy` clause will always run finalized tasks regardless whether previous one succeeded or not. New release command `./gradlew :initializeSonatypeStagingRepository publish :closeAndReleaseRepository publishPlugins -Pversion=${NEW_VERSION}`
1 parent f2e9034 commit 6a5bf06

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
2727
echo "New version: ${NEW_VERSION}"
28-
./gradlew publish closeAndReleaseRepository -Pversion=${NEW_VERSION}
28+
./gradlew :initializeSonatypeStagingRepository publish :closeAndReleaseRepository publishPlugins -Pversion=${NEW_VERSION}
2929
env:
3030
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3131
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,4 @@ tasks {
207207
numberOfRetries = 60
208208
delayBetweenRetriesInMillis = 5000
209209
}
210-
211-
publish {
212-
dependsOn(":initializeSonatypeStagingRepository")
213-
}
214210
}

plugins/graphql-kotlin-gradle-plugin/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ tasks {
4545
System.setProperty("gradle.publish.secret", System.getenv("PLUGIN_PORTAL_SECRET"))
4646
}
4747
}
48-
publish {
49-
dependsOn(":graphql-kotlin-gradle-plugin:publishPlugins")
50-
}
5148
withType<PublishToMavenRepository> {
52-
// explicitly disable maven-publish tasks
49+
// explicitly disable maven-publish tasks - task will be listed but will be disabled
5350
enabled = false
5451
}
5552
test {

0 commit comments

Comments
 (0)