Skip to content

Commit e4ceba6

Browse files
committed
Execute publish and close/release tasks in same gradle call
1 parent 0e38d55 commit e4ceba6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,16 @@ jobs:
114114
run: |
115115
# --max-workers 1 limits Gradle to a single thread even if parallel builds are enabled in the hopes
116116
# of making the the upload to Sonatype Nexus less flaky
117-
./gradlew publishToSonatype --info --max-workers 1
118117
119118
if [[ "$IS_SNAPSHOT_VERSION" == "true" ]]; then
120119
echo "Version is a snapshot. No closing of the repository is necessary."
120+
./gradlew publishToSonatype --info --max-workers 1
121121
elif [[ "$IS_SNAPSHOT_VERSION" == "false" ]]; then
122122
echo "Version is not a snapshot. Trying to close and release repository."
123-
./gradlew closeAndReleaseStagingRepository --info --max-workers 1
123+
# Note: Until https://github.com/gradle-nexus/publish-plugin/issues/19 is fixed
124+
# publish and close/release always have to be executed in the same Gradle call
125+
# or closing will fail with error 'No staging repository with name sonatype created'.
126+
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info --max-workers 1
124127
else
125128
echo "IS_SNAPSHOT_VERSION has unknown value: $IS_SNAPSHOT_VERSION"
126129
exit 1

0 commit comments

Comments
 (0)