Skip to content

Commit

Permalink
chore: fix release action
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed Nov 26, 2024
1 parent f6c9fc4 commit 5251b33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 34 deletions.
10 changes: 4 additions & 6 deletions gradle/publish-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ afterEvaluate {
from components.java
}

artifact androidSourcesJar
artifact javadocJar

pom {
Expand Down Expand Up @@ -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
}
}
32 changes: 4 additions & 28 deletions gradle/publish-root.gradle
Original file line number Diff line number Diff line change
@@ -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')
}
}
}
}
3 changes: 3 additions & 0 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ task docs(dependsOn: dokkaHtml) {
}
}
}
afterEvaluate {
generateMetadataFileForReleasePublication.dependsOn androidSourcesJar
}


0 comments on commit 5251b33

Please sign in to comment.