Skip to content

Commit

Permalink
Add code to commit the maven publish
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgyoung committed Apr 5, 2021
1 parent b407642 commit 833b274
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ The following instructions are for project administrators.
git push --tags
./gradlew release
./gradlew mavenPublish
./gradlew closeAndReleaseRepository

4. Keep checking for a half hour or so at https://repo1.maven.org/maven2/org/altbeacon/android-beacon-library/ to see that the new release shows up.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"

classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down Expand Up @@ -54,5 +54,5 @@ task clean(type: Delete) {
delete rootProject.buildDir
}


apply plugin: 'io.codearte.nexus-staging'

18 changes: 9 additions & 9 deletions gradle/publish-mavencentral.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,12 @@ artifacts {
group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

//ext["signing.keyId"] = ''
//ext["signing.password"] = ''
//ext["signing.secretKeyRingFile"] = ''
//ext["ossrhUsername"] = ''
//ext["ossrhPassword"] = ''
//ext["sonatypeStagingProfileId"] = ''


ext["signing.keyId"] = project.hasProperty('signing.keyId') ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = project.hasProperty('signing.password') ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = project.hasProperty('signing.secretKeyRingFile') ? project.getProperty('signing.secretKeyRingFile') : System.getenv('SIGNING_SECRET_KEY_RING_FILE')
ext["ossrhUsername"] = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
ext["sonatypeStagingProfileId"] = project.hasProperty('sonatypeStagingProfileId') ? project.getProperty('sonatypeStagingProfileId'): System.getenv('SONATYPE_STAGING_PROFILE_ID')
ext["sonatypeStagingProfileId"] = project.hasProperty('sonatypeStagingProfileId') ? project.getProperty('sonatypeStagingProfileId') : System.getenv('SONATYPE_STAGING_PROFILE_ID')

publishing {
publications {
Expand Down Expand Up @@ -118,10 +110,18 @@ publishing {
}
}

nexusStaging {
packageGroup = PUBLISH_GROUP_ID
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
}

signing {
sign publishing.publications
}


task release(dependsOn: [ 'clean', 'build', 'renameAarForRelease', 'androidSourcesJar']) {
doLast {
println "Building with version=$version"
Expand Down

0 comments on commit 833b274

Please sign in to comment.