From 5251b33b3da135720ad019e5ba6ed219653f6fbf Mon Sep 17 00:00:00 2001 From: Brian Giori Date: Tue, 26 Nov 2024 10:39:46 -0800 Subject: [PATCH] chore: fix release action --- gradle/publish-module.gradle | 10 ++++------ gradle/publish-root.gradle | 32 ++++---------------------------- sdk/build.gradle | 3 +++ 3 files changed, 11 insertions(+), 34 deletions(-) diff --git a/gradle/publish-module.gradle b/gradle/publish-module.gradle index d8d2b8d..bf74323 100644 --- a/gradle/publish-module.gradle +++ b/gradle/publish-module.gradle @@ -45,7 +45,6 @@ afterEvaluate { from components.java } - artifact androidSourcesJar artifact javadocJar pom { @@ -77,10 +76,9 @@ afterEvaluate { } } -ext["signing.keyId"] = rootProject.ext["signing.keyId"] -ext["signing.password"] = rootProject.ext["signing.password"] -ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"] - signing { + def signingKey = System.getenv("SIGNING_KEY") + def signingPassword = System.getenv("SIGNING_PASSWORD") + useInMemoryPgpKeys(signingKey, signingPassword) sign publishing.publications -} \ No newline at end of file +} diff --git a/gradle/publish-root.gradle b/gradle/publish-root.gradle index 0bb0328..2c13d47 100644 --- a/gradle/publish-root.gradle +++ b/gradle/publish-root.gradle @@ -1,34 +1,10 @@ -// Create variables with empty default values -ext["ossrhUsername"] = '' -ext["ossrhPassword"] = '' -ext["sonatypeStagingProfileId"] = '' -ext["signing.keyId"] = '' -ext["signing.password"] = '' -ext["signing.secretKeyRingFile"] = '' - -File secretPropsFile = project.rootProject.file('local.properties') -if (secretPropsFile.exists()) { - // Read local.properties file first if it exists - Properties p = new Properties() - new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) } - p.each { name, value -> ext[name] = value } -} else { - // Use system environment variables - ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') - ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') - ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') - ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') - ext["signing.password"] = System.getenv('SIGNING_PASSWORD') - ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE') -} - // Set up Sonatype repository nexusPublishing { repositories { sonatype { - stagingProfileId = sonatypeStagingProfileId - username = ossrhUsername - password = ossrhPassword + stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID') + username = System.getenv('SONATYPE_USERNAME') + password = System.getenv('SONATYPE_PASSWORD') } } -} \ No newline at end of file +} diff --git a/sdk/build.gradle b/sdk/build.gradle index 77a5cd7..bf425cf 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -70,5 +70,8 @@ task docs(dependsOn: dokkaHtml) { } } } +afterEvaluate { + generateMetadataFileForReleasePublication.dependsOn androidSourcesJar +}