Skip to content

Commit

Permalink
Use only sonatype publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
igr committed May 22, 2024
1 parent 51790e8 commit 9bc8699
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ jobs:
echo "Verify gpg secret key"
gpg --list-secret-keys --keyid-format LONG
- name: Publish package
run: ./gradlew clean build publish -Psigning.gnupg.keyName=568EC4DD -Psigning.gnupg.passphrase=${{ secrets.GPG_SECRET_KEY_PASSWORD }}
- name: Publish library
run: ./gradlew clean build publishToSonatype -Psigning.gnupg.keyName=568EC4DD -Psigning.gnupg.passphrase=${{ secrets.GPG_SECRET_KEY_PASSWORD }}
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
23 changes: 6 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,16 @@ publishing {
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.contains('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}

// must be after publishing
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}

nexusPublishing {
repositories {
sonatype()
}
}

// must be after publishing
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}

0 comments on commit 9bc8699

Please sign in to comment.