Skip to content

Commit

Permalink
Prepare publishing to maven Central
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed May 7, 2021
1 parent c2d0a65 commit 91195d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
java-version: 11
distribution: 'adopt'
- name: Publish package
run: ./gradlew --no-parallel publishToSonatype closeAndReleaseSonatypeStagingRepository
run: ./gradlew --no-parallel publishToSonatype closeSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ subprojects {
apply plugin: 'com.android.library'
apply plugin: 'io.freefair.android-maven-jars'
apply plugin: 'maven-publish'
apply plugin: "signing"
apply plugin: "io.freefair.maven-central.validate-poms"

android {
Expand Down Expand Up @@ -82,6 +83,14 @@ subprojects {
}
}

signing {
required { !version.endsWith('SNAPSHOT') && gradle.taskGraph.hasTask("publish") }

def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
}

project.afterEvaluate {
publishing {
publications {
Expand All @@ -94,3 +103,15 @@ subprojects {
}
}
}

nexusPublishing {
repositories {
sonatype {
stagingProfileId = '7e6204597a774f'
}
}
}

tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
}

0 comments on commit 91195d8

Please sign in to comment.