Skip to content

Commit 528a20f

Browse files
Disable signing for JitPack builds
1 parent 17e9d89 commit 528a20f

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'maven-publish'
33

44
ext {
55
PUBLISH_GROUP_ID = 'io.github.tutorialsandroid'
6-
PUBLISH_VERSION = '7.0.3'
6+
PUBLISH_VERSION = '7.0.5'
77
PUBLISH_ARTIFACT_ID = 'progressx'
88
PUBLISH_DESCRIPTION = 'A material style progress wheel that you can integrate into your app'
99
PUBLISH_URL = 'https://github.com/tutorialsandroid/progressx'

sample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "com.developer.progressx.custom"
99
minSdkVersion 23
1010
targetSdkVersion 37
11-
versionCode 12
12-
versionName "7.0.3"
11+
versionCode 13
12+
versionName "7.0.5"
1313
}
1414
buildTypes {
1515
release {

scripts/publish-module.gradle

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ apply plugin: 'signing'
44
group = PUBLISH_GROUP_ID
55
version = PUBLISH_VERSION
66

7+
def isJitPack = System.getenv("JITPACK") == "true"
8+
79
afterEvaluate {
810
publishing {
911
publications {
@@ -46,18 +48,27 @@ afterEvaluate {
4648
}
4749
}
4850

49-
signing {
50-
required {
51-
!version.toString().endsWith("SNAPSHOT") &&
52-
project.hasProperty("signing.keyId") &&
51+
def hasSigningKeys =
52+
project.hasProperty("signing.keyId") &&
5353
project.hasProperty("signing.password") &&
5454
project.hasProperty("signing.secretKeyRingFile") &&
55-
gradle.taskGraph.allTasks.any { task ->
56-
task.name.toLowerCase().contains("publish") &&
57-
!task.name.toLowerCase().contains("mavenlocal")
58-
}
55+
project.property("signing.keyId") &&
56+
project.property("signing.password") &&
57+
project.property("signing.secretKeyRingFile")
58+
59+
signing {
60+
required {
61+
!isJitPack &&
62+
hasSigningKeys &&
63+
!version.toString().endsWith("SNAPSHOT")
5964
}
6065

6166
sign publishing.publications.release
6267
}
68+
69+
tasks.withType(Sign).configureEach {
70+
onlyIf {
71+
!isJitPack && hasSigningKeys
72+
}
73+
}
6374
}

0 commit comments

Comments
 (0)