diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index edeb821..1c5e282 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,3 +29,8 @@ jobs: - name: Write outputs id: publications run: ./gradlew :writePublicationsToGitHubOutput + - uses: actions/upload-artifact@v4 + with: + path: ${{ steps.publications.outputs.publishedFiles }} + compression-level: 0 + if-no-files-found: error diff --git a/build.gradle.kts b/build.gradle.kts index a115bd8..6dcc75c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,5 +14,6 @@ dependencies { tasks.register("writePublicationsToGithubOutputFile", WritePublicationsToGitHubOutputFile::class) { publicationFiles.from(subPublicationFiles) + rootDirectory.set(layout.projectDirectory) githubOutputFile.set(file(providers.environmentVariable("GITHUB_OUTPUT"))) } diff --git a/gradle/build-logic/src/main/kotlin/WritePublicationsToGitHubOutputFile.kt b/gradle/build-logic/src/main/kotlin/WritePublicationsToGitHubOutputFile.kt index 67d13b9..c6b9737 100644 --- a/gradle/build-logic/src/main/kotlin/WritePublicationsToGitHubOutputFile.kt +++ b/gradle/build-logic/src/main/kotlin/WritePublicationsToGitHubOutputFile.kt @@ -1,5 +1,6 @@ import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* @@ -10,6 +11,10 @@ abstract class WritePublicationsToGitHubOutputFile : DefaultTask() { @get:PathSensitive(PathSensitivity.RELATIVE) abstract val publicationFiles: ConfigurableFileCollection + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val rootDirectory: DirectoryProperty + @get:OutputFile abstract val githubOutputFile: RegularFileProperty @@ -21,7 +26,7 @@ abstract class WritePublicationsToGitHubOutputFile : DefaultTask() { separator = "\n", postfix = "\nEOF\n", ) { - it.absolutePath + it.toRelativeString(rootDirectory.get().asFile) } ) }