Skip to content

Commit

Permalink
feat: add a second strategy to release rc-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tschulte committed Nov 21, 2016
1 parent 217e396 commit 0b75b96
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.ajoberstar.gradle.git.release.semver.*
import org.ajoberstar.gradle.git.release.opinion.Strategies

plugins {
id 'java'
id 'de.gliderpilot.semantic-release' version '1.2.0'
Expand All @@ -23,6 +26,19 @@ artifacts {
sourcesJar
javadocJar
}
release {
// add a second strategy to create release candidates from 'rc/.*' branches
versionStrategy semanticRelease.releaseStrategy.copyWith(
// the type is important, without type you would again replace the default strategy
type: 'rc',
selector: { SemVerStrategyState state ->
!state.repoDirty && state.currentBranch.name ==~ /rc\/.*/ &&
semanticRelease.semanticStrategy.canRelease(state) && project.gradle.startParameter.taskNames.find { it == 'release' }
},
preReleaseStrategy: StrategyUtil.all({ it.copyWith(inferredPreRelease: 'rc') } as PartialSemVerStrategy, Strategies.PreRelease.COUNT_INCREMENTED)
)

}
semanticRelease {
repo {
ghToken = project.ext.ghToken
Expand Down

0 comments on commit 0b75b96

Please sign in to comment.