Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

Commit

Permalink
Don't build on local
Browse files Browse the repository at this point in the history
  • Loading branch information
lclc98 committed Nov 25, 2019
1 parent 15656e1 commit 4cab9ef
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allprojects {
apply plugin: 'maven'
apply plugin: 'signing'

version = "${project_version}" + getBuildNumber() + isSnapshot()
version = "${project_version}" + getBuildNumber() + (isSnapshot() ? "-snapshot" : '')

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand Down Expand Up @@ -58,6 +58,10 @@ allprojects {
sign configurations.archives
}

tasks.withType(Sign) {
onlyIf { !isSnapshot() }
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -122,10 +126,10 @@ static String getBuildNumber() {
return System.getenv("BUILD_NUMBER") ?: "0"
}

static String isSnapshot() {
static boolean isSnapshot() {
String ref = System.getenv("GITHUB_REF");
if (ref != null && ref.startsWith("refs/tags/v")) {
return ""
return false
}
return "-snapshot"
return true
}

0 comments on commit 4cab9ef

Please sign in to comment.