Skip to content

Commit

Permalink
Rename artifacts before attestation (#3848)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Marc Philipp <mail@marcphilipp.de>
  • Loading branch information
sormuras and marcphilipp authored Jun 10, 2024
1 parent 693f586 commit f11bb65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions documentation/documentation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ asciidoctorj {
requires(file("src/docs/asciidoc/resources/themes/rouge_junit.rb"))
}

val buildRevision: String by rootProject.extra
val snapshot = rootProject.version.toString().contains("SNAPSHOT")
val docsVersion = if (snapshot) "snapshot" else rootProject.version
val releaseBranch = if (snapshot) "HEAD" else "r${rootProject.version}"
Expand Down Expand Up @@ -516,6 +517,7 @@ tasks {
val prepareGitHubAttestation by registering(Sync::class) {
from(attestationClasspath)
into(layout.buildDirectory.dir("attestation"))
rename("(.*)-SNAPSHOT.jar", "$1-SNAPSHOT+${buildRevision.substring(0, 7)}.jar")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ val buildTime: String by extra { timeFormatter.format(buildTimeAndDate) }
val buildRevision: String by extra {
providers.exec {
commandLine("git", "rev-parse", "--verify", "HEAD")
}.standardOutput.asText.get()
}.standardOutput.asText.get().trim()
}

0 comments on commit f11bb65

Please sign in to comment.