Skip to content

Commit

Permalink
Wait central repo close
Browse files Browse the repository at this point in the history
- Adding finalizeDeployArtifacts task which closes and
  releases repo in nexus.
- Relates #165
  • Loading branch information
jvalkeal committed Apr 25, 2023
1 parent 91c5626 commit 47d5e8e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.gradle.api.Action;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;

import io.github.gradlenexus.publishplugin.NexusPublishExtension;
import io.github.gradlenexus.publishplugin.NexusPublishPlugin;
Expand All @@ -42,5 +43,12 @@ public void execute(NexusRepository nexusRepository) {
});
nexusPublishing.getConnectTimeout().set(Duration.ofMinutes(3));
nexusPublishing.getClientTimeout().set(Duration.ofMinutes(3));

// Ensure release build automatically closes and releases staging repository
Task finalizeDeployArtifacts = project.task("finalizeDeployArtifacts");
if (Utils.isRelease(project) && project.hasProperty("ossrhUsername")) {
Task closeAndReleaseOssrhStagingRepository = project.getTasks().findByName("closeAndReleaseOssrhStagingRepository");
finalizeDeployArtifacts.dependsOn(closeAndReleaseOssrhStagingRepository);
}
}
}

0 comments on commit 47d5e8e

Please sign in to comment.