diff --git a/build.gradle b/build.gradle index 9a14a0a1a..9d84b6cf8 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ buildscript { dependencies { classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0' classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.5.3" + classpath 'gradle.plugin.co.riiid:gradle-github-plugin:0.4.2' } } @@ -209,6 +210,7 @@ subprojects { } } + uploadArchives.dependsOn('build') uploadArchives { doFirst { if(!project.hasProperty("projVersion") || "".equals(project.projVersion.trim())) @@ -253,9 +255,17 @@ subprojects { } } } + } nexusStaging { + packageGroup = 'org.webpieces' + stagingProfileId = '683f50db65952' username = sonatypeUsername password = sonatypePassword } + +//promoteRepository.dependsOn('closeRepository') + +task release(dependsOn: ':webserver:githubRelease') + diff --git a/release.sh b/release.sh index c2b900dd0..d8c29f77c 100755 --- a/release.sh +++ b/release.sh @@ -3,4 +3,4 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) cd $DIR -./gradlew -PprojVersion=$1 build uploadArchives closeAndPromoteRepository +./gradlew -PprojVersion=$1 clean githubRelease uploadArchives diff --git a/webserver/build.gradle b/webserver/build.gradle index eef201183..032d00e73 100644 --- a/webserver/build.gradle +++ b/webserver/build.gradle @@ -1,3 +1,5 @@ +apply plugin: 'co.riiid.gradle' + project.ext { stagingDirName = 'webpiecesServerBuilder' outputStagingDir = new File(buildDir, stagingDirName) @@ -19,6 +21,9 @@ project('webpiecesServerBuilder:templateProject:TEMPLATEAPPNAME-prod') { testCompile project(':webserver:http-webserver-test') testCompile deps['selenium'] } + + task uploadArchives(overwrite: true) << { + } } project('webpiecesServerBuilder:templateProject:TEMPLATEAPPNAME-dev') { @@ -28,6 +33,9 @@ project('webpiecesServerBuilder:templateProject:TEMPLATEAPPNAME-dev') { compile project(':webserver:http-templating-dev') compile project(':webserver:webpiecesServerBuilder:templateProject:TEMPLATEAPPNAME-prod') } + + task uploadArchives(overwrite: true) << { + } } task stageTemplate(type: Copy) { @@ -61,6 +69,7 @@ task copyGradleTemplate(type: Copy, dependsOn: 'stageTemplate') { include 'build.gradle.template' rename { file -> 'build.gradle' } expand(version: version, title: 'ProjectInfo') + outputs.upToDateWhen { false } } task zipGradleTemplate(type: Zip, dependsOn: 'copyGradleTemplate') { @@ -70,3 +79,28 @@ task zipGradleTemplate(type: Zip, dependsOn: 'copyGradleTemplate') { } assemble.dependsOn(['zipGradleTemplate']) + +task uploadArchives(overwrite: true) << { +} + +github { + owner = 'deanhiller' + repo = 'webpieces' + token = githubToken + tagName = version + name = 'webpiecesServerBuilder'+version + body = 'Official Release of '+version + assets = [ + zipGradleTemplate.archivePath + ] +} + +githubRelease.dependsOn(':webserver:build') +githubRelease { + doFirst { + if(!project.hasProperty("projVersion") || "".equals(project.projVersion.trim())) + throw new InvalidUserDataException("-PprojVersion property was not defined and must be when uploadArchives is run"); + + println("the path="+github.assets) + } +}