Skip to content

Commit f9671e7

Browse files
author
Anuraag Agrawal
authored
Sign artifacts in build instead of in bintray. (#1778)
1 parent 2222905 commit f9671e7

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.github/workflows/nightly.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ jobs:
151151
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
152152
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
153153
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
154+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
155+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
154156
run: ./gradlew snapshot --stacktrace
155157

156158
issue:

.github/workflows/patch-release-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,5 @@ jobs:
7474
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
7575
GRGIT_USER: ${{ github.actor }}
7676
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
77+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
78+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}

.github/workflows/release-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ jobs:
2626
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
2727
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
2828
GRGIT_USER: ${{ github.actor }}
29-
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
29+
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
30+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
31+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}

gradle/publish.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
23
apply plugin: 'com.jfrog.artifactory'
34
apply plugin: 'com.jfrog.bintray'
45

@@ -103,10 +104,6 @@ bintray {
103104
name = project.version
104105
released = new Date()
105106

106-
gpg {
107-
sign = true
108-
}
109-
110107
mavenCentralSync {
111108
user = System.getenv("SONATYPE_USER")
112109
password = System.getenv("SONATYPE_KEY")
@@ -133,3 +130,12 @@ artifactoryPublish {
133130
enabled = version.toString().contains('SNAPSHOT')
134131
publications('maven')
135132
}
133+
134+
tasks.withType(Sign).configureEach {
135+
onlyIf { System.getenv("CI") != null }
136+
}
137+
138+
signing {
139+
useInMemoryPgpKeys(System.getenv("GPG_PRIVATE_KEY"), System.getenv("GPG_PASSWORD"))
140+
sign publishing.publications.maven
141+
}

0 commit comments

Comments
 (0)