From 1d9ba41d6abd2b102d955d401c45a2cee878f8ec Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Fri, 7 Jun 2024 10:45:53 +0530 Subject: [PATCH] Fixed: CD is failing because there are multiple jar and sources files to upload. * It was due to we had upgraded the Nexus plugin while upgrading the gradle. So this new version of Nexus generates the sources and jar files itself, and we have a task where we are generating the sources and jar so due to this it detected the multiple jar and sources files and failed the CD. So we have removed our task so that the Nexus plugin will generate and upload the jar and source files itself. --- .github/workflows/cd.yml | 2 +- lib/publish.gradle | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 04c153b..a1daf30 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -22,7 +22,7 @@ jobs: run: bash ./install_deps.sh - name: Compile and prepare package - run: ./gradlew buildHeaders build assemble androidSourcesJar + run: ./gradlew buildHeaders build assemble - name: Publish to Maven Central run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository diff --git a/lib/publish.gradle b/lib/publish.gradle index fd2904d..c590958 100644 --- a/lib/publish.gradle +++ b/lib/publish.gradle @@ -1,23 +1,6 @@ apply plugin: 'maven-publish' apply plugin: 'signing' -tasks.register('androidSourcesJar', Jar) { - archiveClassifier.set('sources') - if (project.plugins.findPlugin("com.android.library")) { - // For Android libraries - from android.sourceSets.main.java.srcDirs - from android.sourceSets.main.kotlin.srcDirs - } else { - // For pure Kotlin libraries, in case you have them - from sourceSets.main.java.srcDirs - from sourceSets.main.kotlin.srcDirs - } -} - -artifacts { - archives androidSourcesJar -} - def siteUrl = 'https://www.kiwix.org/en/' def gitUrl = 'https://github.com/kiwix/libkiwix.git' @@ -35,7 +18,6 @@ afterEvaluate { from components.release - artifact androidSourcesJar pom { name = ARTIFACT_ID description = 'LibKiwix Android library' @@ -71,13 +53,6 @@ afterEvaluate { } } } - - // Set dependency for the metadata file generation task - tasks.withType(GenerateModuleMetadata).tap { - configureEach { - dependsOn tasks.named("androidSourcesJar") - } - } } signing {