Skip to content

Commit baf3ab5

Browse files
committed
Pass details via command line gradle property
1 parent bc7a856 commit baf3ab5

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.github/workflows/publish-android-maven-central.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
run: |
2222
echo "${{ secrets.OSSRH_GPG }}" > private-key.asc
2323
gpg --import --batch private-key.asc
24+
echo "SIGNING_SECRET_KEY_RING_FILE=$(pwd)/private-key.asc" >> $GITHUB_ENV
2425
2526
- name: Cache Gradle packages
2627
uses: actions/cache@v2
@@ -42,4 +43,6 @@ jobs:
4243
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
4344
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
4445
working-directory: ./src/AndroidClient
45-
run: ./gradlew android:publishAllPublicationsToOSSRHRepository
46+
run: ./gradlew android:publishAllPublicationsToOSSRHRepository \
47+
-Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} \
48+
-Psigning.secretKeyRingFile=${{ env.SIGNING_SECRET_KEY_RING_FILE }}

.github/workflows/publish-client-maven-central.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
run: |
2222
echo "${{ secrets.OSSRH_GPG }}" > private-key.asc
2323
gpg --import --batch private-key.asc
24+
echo "SIGNING_SECRET_KEY_RING_FILE=$(pwd)/private-key.asc" >> $GITHUB_ENV
2425
2526
- name: Cache Gradle packages
2627
uses: actions/cache@v2
@@ -42,4 +43,6 @@ jobs:
4243
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
4344
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
4445
working-directory: ./src/AndroidClient
45-
run: ./gradlew client:publishAllPublicationsToOSSRHRepository
46+
run: ./gradlew client:publishAllPublicationsToOSSRHRepository \
47+
-Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} \
48+
-Psigning.secretKeyRingFile=${{ env.SIGNING_SECRET_KEY_RING_FILE }}

src/AndroidClient/android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ if (project.hasProperty('versionSuffix')) {
1111
version = "${version}-${versionSuffix}"
1212
}
1313

14-
if (project.hasProperty('signing.keyId') || System.getenv("SIGNING_KEY_ID")) {
14+
if (project.hasProperty('signing.keyId')) {
1515
println "Signing enabled"
1616
signing {
1717
sign configurations.archives
18-
keyId = project.findProperty("signing.keyId") ?: System.getenv("SIGNING_KEY_ID")
1918
}
2019
} else {
2120
println "Signing disabled"

src/AndroidClient/client/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@ if (project.hasProperty('versionSuffix')) {
1111
version = "${version}-${versionSuffix}"
1212
}
1313

14-
apply plugin: 'signing'
15-
16-
17-
if (project.hasProperty('signing.keyId') || System.getenv("SIGNING_KEY_ID")) {
14+
if (project.hasProperty('signing.keyId')) {
1815
println "Signing enabled"
1916
signing {
2017
sign configurations.archives
21-
keyId = project.findProperty("signing.keyId") ?: System.getenv("SIGNING_KEY_ID")
2218
}
2319
} else {
2420
println "Signing disabled"

0 commit comments

Comments
 (0)