From f73d120fe0d6c159699068d9ab298c3cbe422643 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Fri, 3 Oct 2025 15:30:10 +0200 Subject: [PATCH] [#2570] Hibernate Reactive builds will no longer publish docs to https://hibernate.org --- release/build.gradle | 93 +++----------------------------------------- 1 file changed, 5 insertions(+), 88 deletions(-) diff --git a/release/build.gradle b/release/build.gradle index 2ec9a4a45..8a9b5be24 100644 --- a/release/build.gradle +++ b/release/build.gradle @@ -3,29 +3,15 @@ import java.nio.charset.StandardCharsets plugins { id "hr-java-library" } -ext { - // Select which repository to use for publishing the documentation - // Example: - // ./gradlew uploadDocumentation \ - // -PdocPublishRepoUri="git@github.com:DavideD/hibernate.org.git" \ - // -PdocPublishBranch="staging" - if ( !project.hasProperty('docPublishRepoUri') ) { - docPublishRepoUri = 'git@github.com:hibernate/hibernate.org.git' - } - if ( !project.hasProperty('docPublishBranch') ) { - docPublishBranch = 'staging' - } -} description = 'Release module' // (Optional) before uploading the documentation, you can check // the generated website under release/build/hibernate.org with: // ./gradlew gitPublishCopy -// To publish the documentation: -// 1. Add the relevant SSH key to your SSH agent. -// 2. Execute this: -// ./gradlew uploadDocumentation -PdocPublishBranch=production +// The generated documentation are copied to the +// rootProject.layout.buildDirectory.dir("staging-deploy/documentation") by the updateDocumentationTask +// while the publishing is delegated to the https://github.com/hibernate/hibernate-release-scripts // To tag a version and trigger a release on CI (which will include publishing to Bintray and publishing documentation): // ./gradlew ciRelease -PreleaseVersion=x.y.z.Final -PdevelopmentVersion=x.y.z-SNAPSHOT -PgitRemote=origin -PgitBranch=main @@ -36,9 +22,6 @@ final Directory documentationDir = project(":documentation").layout.buildDirecto // Relative path on the static website where the documentation is located final String docWebsiteRelativePath = "reactive/documentation/${projectVersion.family}" -// The location of the docs when the website has been cloned -final Directory docWebsiteReactiveFolder = project.layout.buildDirectory.dir( "docs-website/${docWebsiteRelativePath}" ).get() - def releaseChecksTask = tasks.register( "releaseChecks" ) { description 'Checks and preparation for release' group 'Release' @@ -101,30 +84,6 @@ def assembleDocumentationTask = tasks.register( 'assembleDocumentation' ) { } assemble.dependsOn assembleDocumentationTask -/** -* Clone the website -*/ -def removeDocsWebsiteTask = tasks.register( 'removeDocsWebsite', Delete ) { - delete project.layout.buildDirectory.dir( "docs-website" ) -} - -def cloneDocsWebsiteTask = tasks.register( 'cloneDocsWebsite', Exec ) { - dependsOn removeDocsWebsiteTask - // Assure that the buildDir exists. Otherwise this task will fail. - dependsOn compileJava - workingDir project.layout.buildDirectory - commandLine 'git', 'clone', docPublishRepoUri, '-b', docPublishBranch, '--sparse', '--depth', '1', 'docs-website' -} - -def sparseCheckoutDocumentationTask = tasks.register( 'sparseCheckoutDocumentation', Exec ) { - dependsOn cloneDocsWebsiteTask - workingDir project.layout.buildDirectory.dir( "docs-website" ) - commandLine 'git', 'sparse-checkout', 'set', docWebsiteRelativePath -} - -/** -* Update the docs on the cloned website -*/ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) { description 'Updates `gradle/version.properties` file to the specified release-version' group 'Release' @@ -139,7 +98,7 @@ def changeToReleaseVersionTask = tasks.register( 'changeToReleaseVersion' ) { def updateDocumentationTask = tasks.register( 'updateDocumentation' ) { description "Update the documentation on the cloned static website" - dependsOn assembleDocumentationTask, sparseCheckoutDocumentationTask + dependsOn assembleDocumentationTask mustRunAfter changeToReleaseVersion // copy documentation outputs into target/documentation: @@ -147,26 +106,13 @@ def updateDocumentationTask = tasks.register( 'updateDocumentation' ) { // * it is also used as a base to build a staged directory for documentation upload doLast { - // delete the folders in case some files have been removed - delete docWebsiteReactiveFolder.dir("javadocs"), docWebsiteReactiveFolder.dir("reference") - // Aggregated JavaDoc - copy { - from documentationDir.dir("javadocs") - into docWebsiteReactiveFolder.dir("javadocs") - } - copy { from documentationDir.dir("javadocs") into rootProject.layout.buildDirectory.dir("staging-deploy/documentation/javadocs") } // Reference Documentation - copy { - from documentationDir.dir("asciidoc/reference/html_single") - into docWebsiteReactiveFolder.dir("reference/html_single") - } - copy { from documentationDir.dir("asciidoc/reference/html_single") into rootProject.layout.buildDirectory.dir("staging-deploy/documentation/reference/html_single") @@ -174,35 +120,6 @@ def updateDocumentationTask = tasks.register( 'updateDocumentation' ) { } } -def stageDocChangesTask = tasks.register( 'stageDocChanges', Exec ) { - dependsOn updateDocumentationTask - workingDir project.layout.buildDirectory.dir( "docs-website" ) - commandLine 'git', 'add', '-A', '.' -} - -def commitDocChangesTask = tasks.register( 'commitDocChanges', Exec ) { - dependsOn stageDocChangesTask - workingDir project.layout.buildDirectory.dir( "docs-website" ) - commandLine 'git', 'commit', '-m', "[HR] Hibernate Reactive documentation for ${projectVersion}" -} - -def pushDocChangesTask = tasks.register( 'pushDocChanges', Exec ) { - description "Push documentation changes on the remote repository" - dependsOn commitDocChangesTask - workingDir project.layout.buildDirectory.dir( "docs-website" ) - commandLine 'git', 'push', '--atomic', 'origin', docPublishBranch -} - -def uploadDocumentationTask = tasks.register( 'uploadDocumentation' ) { - description "Upload documentation on the website" - group "Release" - dependsOn pushDocChangesTask - - doLast { - logger.lifecycle "Documentation published on '${docPublishRepoUri}' branch '${docPublishBranch}'" - } -} - def gitPreparationForReleaseTask = tasks.register( 'gitPreparationForRelease' ) { dependsOn releaseChecksTask, changeToReleaseVersionTask finalizedBy updateDocumentationTask @@ -248,7 +165,7 @@ void updateVersionFile(var version) { } def publishReleaseArtifactsTask = tasks.register( 'publishReleaseArtifacts' ) { - dependsOn uploadDocumentationTask + dependsOn updateDocumentationTask mustRunAfter gitPreparationForReleaseTask }