Skip to content

Commit

Permalink
nearly there on nexus publishing and github releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
deanhiller committed Jul 13, 2016
1 parent ea72397 commit d763e07
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down Expand Up @@ -209,6 +210,7 @@ subprojects {
}
}

uploadArchives.dependsOn('build')
uploadArchives {
doFirst {
if(!project.hasProperty("projVersion") || "".equals(project.projVersion.trim()))
Expand Down Expand Up @@ -253,9 +255,17 @@ subprojects {
}
}
}

}

nexusStaging {
packageGroup = 'org.webpieces'
stagingProfileId = '683f50db65952'
username = sonatypeUsername
password = sonatypePassword
}

//promoteRepository.dependsOn('closeRepository')

task release(dependsOn: ':webserver:githubRelease')

2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 34 additions & 0 deletions webserver/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apply plugin: 'co.riiid.gradle'

project.ext {
stagingDirName = 'webpiecesServerBuilder'
outputStagingDir = new File(buildDir, stagingDirName)
Expand All @@ -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') {
Expand All @@ -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) {
Expand Down Expand Up @@ -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') {
Expand All @@ -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)
}
}

0 comments on commit d763e07

Please sign in to comment.