Skip to content

Commit

Permalink
Add scm section and signing to maven-publish.gradle(#35)(#36)(#37)(#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
fnobilia committed Nov 24, 2020
1 parent 69b369f commit b87756e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/gradle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ jobs:
path: ~/.gradle/caches
key: ${{ runner.os }}-release-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Publish with Gradle
run: ./gradlew publish -PreleaseVersion=$RELEASE_VERSION
run: ./gradlew publish -PreleaseVersion=$RELEASE_VERSION -Psigning.gnupg.executable='gpg' -Psigning.gnupg.keyName='${{secrets.OSSRH_GPG_SECRET_KEY_ID }}' -Psigning.gnupg.passphrase='${{secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}'
env:
RELEASE_VERSION: ${{ steps.tag.outputs.tag }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
15 changes: 15 additions & 0 deletions maven-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ publishing {
url = 'https://github.com/data-rocks-team/schemaregistry-junit/blob/main/LICENSE'
}
}
scm {
connection = 'scm:git:git://github.com/data-rocks-team/schemaregistry-junit.git'
developerConnection = 'scm:git:ssh://github.com/data-rocks-team/schemaregistry-junit.git'
url = 'https://github.com/data-rocks-team/schemaregistry-junit'
}
developers {
developer {
name = 'Francesco Nobilia'
Expand All @@ -51,3 +56,13 @@ publishing {
}
}
}

// Apply signature only if needed
if (project.hasProperty('signing.gnupg.passphrase')) {
apply plugin: 'signing'

signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
}

0 comments on commit b87756e

Please sign in to comment.