-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from nats-io/travis_deploy
Travis deploy
- Loading branch information
Showing
6 changed files
with
105 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,27 @@ plugins { | |
id 'java' | ||
id 'jacoco' | ||
id 'maven' | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'com.github.kt3k.coveralls' version '2.6.3' | ||
id "io.codearte.nexus-staging" version "0.11.0" | ||
id 'com.github.kt3k.coveralls' version '2.8.4' | ||
id 'osgi' | ||
id 'io.codearte.nexus-staging' version '0.21.0' | ||
id "de.marcphilipp.nexus-publish" version "0.3.0" | ||
} | ||
|
||
// Update version here, repeated check-ins not into master will have snapshot on them | ||
// Be sure to update Nats.java with the latest version, the change log and the package-info.java | ||
def versionMajor = 2 | ||
def versionMinor = 6 | ||
def versionPatch = 2 | ||
def versionPatch = 3 | ||
def versionModifier = "" | ||
def jarVersion = "2.6.2" | ||
def jarVersion = "2.6.3" | ||
def branch = System.getenv("TRAVIS_BRANCH"); | ||
def tag = System.getenv("TRAVIS_TAG"); | ||
def travisTestBranch = "travis_deploy" | ||
|
||
def getVersionName = { -> | ||
if ("true".equals(System.getenv("TRAVIS_PULL_REQUEST")) || !"master".equals(branch)) { | ||
if (!"master".equals(branch) || tag == "") { | ||
versionModifier = "-SNAPSHOT" | ||
} | ||
|
||
|
@@ -45,7 +49,7 @@ if (System.getenv('SONATYPE_USERNAME') != null) { | |
} | ||
|
||
tasks.withType(Sign) { | ||
onlyIf { "master".equals(branch) } | ||
onlyIf { "master".equals(branch) || travisTestBranch.equals(branch) } | ||
} | ||
|
||
repositories { | ||
|
@@ -173,28 +177,24 @@ signing { | |
sign configurations.archives | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
if (project.hasProperty("local_archives") || ("true".equals(System.getenv("TRAVIS_PULL_REQUEST")))) { | ||
repository(url: "file://$buildDir/repos") | ||
} else if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: project.getProperty('ossrhUsername'), password: project.getProperty('ossrhPassword')) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: project.getProperty('ossrhUsername'), password: project.getProperty('ossrhPassword')) | ||
} | ||
} | ||
|
||
pom.project { | ||
name 'jnats' | ||
packaging 'jar' | ||
description 'Client library for working with the NATS messaging system.' | ||
url 'https://github.com/nats-io/nats.java' | ||
nexusStaging { | ||
packageGroup = group | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
artifact sourcesJar | ||
artifact examplesJar | ||
artifact javadocJar | ||
pom { | ||
name = 'jnats' | ||
packaging = 'jar' | ||
groupId = group | ||
artifactId = archivesBaseName | ||
description = 'Client library for working with the NATS messaging system.' | ||
url = 'https://github.com/nats-io/nats.java' | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
|
@@ -203,10 +203,10 @@ uploadArchives { | |
} | ||
developers { | ||
developer { | ||
id="synadia" | ||
name "Synadia" | ||
email "[email protected]" | ||
url "https://nats.io" | ||
id = "synadia" | ||
name = "Synadia" | ||
email = "[email protected]" | ||
url = "https://nats.io" | ||
} | ||
} | ||
scm { | ||
|
@@ -215,4 +215,13 @@ uploadArchives { | |
} | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
username = project.getProperty('ossrhUsername') | ||
password = project.getProperty('ossrhPassword') | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters