File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments