From eb57816a44526d40d03d2570bff96e7ddf4bfd29 Mon Sep 17 00:00:00 2001 From: thc202 Date: Mon, 9 Oct 2023 20:54:39 +0100 Subject: [PATCH] Correct release process Ensure the output of the BOM tasks don't overlap. Only run the JAR tasks for the BOMs when needed. Reset the release state of pending add-ons. Signed-off-by: thc202 --- .github/workflows/release-add-on.yml | 2 -- addOns/addOns.gradle.kts | 13 ++++++++++++- addOns/webdrivers/webdriverlinux/gradle.properties | 2 +- addOns/webdrivers/webdrivermacos/gradle.properties | 2 +- .../webdrivers/webdriverwindows/gradle.properties | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-add-on.yml b/.github/workflows/release-add-on.yml index fd4225f62f2..8b271e2cf70 100644 --- a/.github/workflows/release-add-on.yml +++ b/.github/workflows/release-add-on.yml @@ -23,8 +23,6 @@ jobs: java-version: 11 - name: Generate Release State run: ./gradlew :addOns:generateReleaseStateLastCommit - - name: Generate JARs for BOM data - run: ./gradlew -Dorg.gradle.jvmargs=-Xmx4g jar - name: Build and Release Add-On env: ZAPBOT_TOKEN: ${{ secrets.ZAPBOT_TOKEN }} diff --git a/addOns/addOns.gradle.kts b/addOns/addOns.gradle.kts index 59134257907..88a9a749ed8 100644 --- a/addOns/addOns.gradle.kts +++ b/addOns/addOns.gradle.kts @@ -75,6 +75,7 @@ val createPullRequestNextDevIter by tasks.registering(CreatePullRequest::class) } val releaseAddOn by tasks.registering +val allJarsForBom by tasks.registering val crowdinExcludedProjects = setOf( childProjects.get("dev"), @@ -181,10 +182,20 @@ subprojects { } } + allJarsForBom { + dependsOn(tasks.named(JavaPlugin.JAR_TASK_NAME)) + } + + val cyclonedxBom by tasks.existing(CycloneDxTask::class) { + setDestination(file("$buildDir/reports/bom-all")) + mustRunAfter(allJarsForBom) + } + val cyclonedxRuntimeBom by tasks.registering(CycloneDxTask::class) { setIncludeConfigs(listOf(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)) setDestination(file("$buildDir/reports/bom-runtime")) setOutputFormat("json") + mustRunAfter(allJarsForBom) } tasks.named(AddOnPlugin.JAR_ZAP_ADD_ON_TASK_NAME) { @@ -230,7 +241,6 @@ subprojects { assets { register("bom") { - val cyclonedxBom by tasks.existing(CycloneDxTask::class) file.set(cyclonedxBom.map { project.layout.projectDirectory.file(File(it.destination.get(), "${it.outputName.get()}.json").absolutePath) }) contentType.set("application/json") } @@ -239,6 +249,7 @@ subprojects { val crowdinUploadSourceFiles = if (useCrowdin) project.tasks.named("crowdinUploadSourceFiles") else null releaseAddOn { + dependsOn(allJarsForBom) dependsOn(createReleaseAddOn) dependsOn(handleRelease) diff --git a/addOns/webdrivers/webdriverlinux/gradle.properties b/addOns/webdrivers/webdriverlinux/gradle.properties index c03fd0087f1..313286c9a6f 100644 --- a/addOns/webdrivers/webdriverlinux/gradle.properties +++ b/addOns/webdrivers/webdriverlinux/gradle.properties @@ -1,2 +1,2 @@ version=63 -release=true +release=false diff --git a/addOns/webdrivers/webdrivermacos/gradle.properties b/addOns/webdrivers/webdrivermacos/gradle.properties index c03fd0087f1..313286c9a6f 100644 --- a/addOns/webdrivers/webdrivermacos/gradle.properties +++ b/addOns/webdrivers/webdrivermacos/gradle.properties @@ -1,2 +1,2 @@ version=63 -release=true +release=false diff --git a/addOns/webdrivers/webdriverwindows/gradle.properties b/addOns/webdrivers/webdriverwindows/gradle.properties index c03fd0087f1..313286c9a6f 100644 --- a/addOns/webdrivers/webdriverwindows/gradle.properties +++ b/addOns/webdrivers/webdriverwindows/gradle.properties @@ -1,2 +1,2 @@ version=63 -release=true +release=false