Skip to content

Commit

Permalink
PredefinedVersionCreator handling main branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
bgalek committed May 23, 2022
1 parent 2117759 commit b1183fc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/release.yml

This file was deleted.

6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ scmVersion {
pre 'fileUpdate', [files: ['README.md', 'mkdocs.yml'], pattern: { v, p -> /'$v'/ }, replacement: { v, p -> "'$v'" }]
pre 'commit'
}

versionCreator 'versionWithBranch'
}

group = 'pl.allegro.tech.build'
Expand Down Expand Up @@ -133,8 +131,6 @@ publishing {
publications {
sonatype(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = project.name
description = 'Gradle release and version management plugin'
Expand All @@ -143,7 +139,7 @@ publishing {
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum PredefinedVersionCreator {
}),

VERSION_WITH_BRANCH('versionWithBranch', { String versionFromTag, ScmPosition position ->
if (position.branch != 'master' && position.branch != 'HEAD') {
if ((position.branch != 'master' && position.branch != 'main') && position.branch != 'HEAD') {
return "$versionFromTag-$position.branch".toString()
}
return versionFromTag
Expand Down

0 comments on commit b1183fc

Please sign in to comment.