Skip to content

Commit 04276e4

Browse files
committed
Trigger release build only with annotated tags
Git best practice is to tag releases with annotated tags. This commit updates the build script to ignore lightweight tags.
1 parent 0f7a3b2 commit 04276e4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,13 @@ def getGitTag() {
185185
logger.warn("HEAD has ${tags.size()} tags. Making a snapshot build")
186186
return null
187187
}
188-
def tagName = tags[0].name
189-
logger.lifecycle("Found tag $tagName. Making a release build")
190-
return tagName
188+
def tag = tags[0]
189+
if (tag.tagger == null || tag.dateTime == null) {
190+
logger.warn("Found lightweight tag ${tag.name}. Making a snapshot build")
191+
return null
192+
}
193+
logger.lifecycle("Found annotated tag ${tag.name}. Making a release build")
194+
return tag.name
191195
}
192196

193197
def static getGitTags(grgit) {

0 commit comments

Comments
 (0)