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:
114
114
run : |
115
115
# --max-workers 1 limits Gradle to a single thread even if parallel builds are enabled in the hopes
116
116
# of making the the upload to Sonatype Nexus less flaky
117
- ./gradlew publishToSonatype --info --max-workers 1
118
117
119
118
if [[ "$IS_SNAPSHOT_VERSION" == "true" ]]; then
120
119
echo "Version is a snapshot. No closing of the repository is necessary."
120
+ ./gradlew publishToSonatype --info --max-workers 1
121
121
elif [[ "$IS_SNAPSHOT_VERSION" == "false" ]]; then
122
122
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
124
127
else
125
128
echo "IS_SNAPSHOT_VERSION has unknown value: $IS_SNAPSHOT_VERSION"
126
129
exit 1
You can’t perform that action at this time.
0 commit comments