Skip to content

Commit

Permalink
Correct release process
Browse files Browse the repository at this point in the history
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 <thc202@gmail.com>
  • Loading branch information
thc202 committed Oct 9, 2023
1 parent 64aeff0 commit eb57816
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/release-add-on.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 12 additions & 1 deletion addOns/addOns.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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<Jar>(AddOnPlugin.JAR_ZAP_ADD_ON_TASK_NAME) {
Expand Down Expand Up @@ -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")
}
Expand All @@ -239,6 +249,7 @@ subprojects {

val crowdinUploadSourceFiles = if (useCrowdin) project.tasks.named("crowdinUploadSourceFiles") else null
releaseAddOn {
dependsOn(allJarsForBom)
dependsOn(createReleaseAddOn)

dependsOn(handleRelease)
Expand Down
2 changes: 1 addition & 1 deletion addOns/webdrivers/webdriverlinux/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=63
release=true
release=false
2 changes: 1 addition & 1 deletion addOns/webdrivers/webdrivermacos/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=63
release=true
release=false
2 changes: 1 addition & 1 deletion addOns/webdrivers/webdriverwindows/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=63
release=true
release=false

0 comments on commit eb57816

Please sign in to comment.