Skip to content

Commit

Permalink
Improve build attestation (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhbd authored Oct 13, 2024
1 parent 9f5e6ab commit 952ec16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 39 deletions.
26 changes: 0 additions & 26 deletions gradle/build-logic/src/main/kotlin/SharePublications.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract class WritePublicationsToGitHubOutputFile : DefaultTask() {
internal fun action() {
githubOutputFile.get().asFile.writeText(
publicationFiles.joinToString(prefix = "publishedFiles=", separator = ",") {
it.readText()
it.absolutePath
}
)
}
Expand Down
22 changes: 10 additions & 12 deletions gradle/build-logic/src/main/kotlin/setup.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,17 @@ tasks.withType<AbstractArchiveTask>().configureEach {
dirPermissions {}
}

val githubPublications = configurations.consumable("githubPublications") {
configurations.consumable("githubPublications") {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named("GITHUB_OUTPUT"))
}
outgoing {
artifacts(provider {
publishing.publications.withType<MavenPublication>().flatMap {
it.artifacts
}.map {
it.file
}
})
}
}

val sharePublications by tasks.registering(SharePublications::class) {
sourceFiles.from(publishing.publications.withType<MavenPublication>().flatMap {
it.artifacts
}.map {
it.file
})
targetFile.set(layout.buildDirectory.file("github/publications/outputFiles.txt"))
}

artifacts.add(githubPublications.name, sharePublications)

0 comments on commit 952ec16

Please sign in to comment.