mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 22:16:22 +00:00
build: adjust version meta message
This commit is contained in:
1 file changed
+4
-3
+4
-3
@@ -209,6 +209,10 @@ logger.lifecycle("Building HuskHomes ${version} by William278")
|
|||||||
|
|
||||||
@SuppressWarnings('GrMethodMayBeStatic')
|
@SuppressWarnings('GrMethodMayBeStatic')
|
||||||
def versionMetadata() {
|
def versionMetadata() {
|
||||||
|
if (grgit == null) {
|
||||||
|
return '-' + System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
|
||||||
|
}
|
||||||
|
|
||||||
// Get if there is a tag for this commit
|
// Get if there is a tag for this commit
|
||||||
def tag = grgit.tag.list().find { it.commit.id == grgit.head().id }
|
def tag = grgit.tag.list().find { it.commit.id == grgit.head().id }
|
||||||
if (tag != null) {
|
if (tag != null) {
|
||||||
@@ -216,8 +220,5 @@ def versionMetadata() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, get the last commit hash and if it's a clean head
|
// Otherwise, get the last commit hash and if it's a clean head
|
||||||
if (grgit == null) {
|
|
||||||
return '-' + System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
|
|
||||||
}
|
|
||||||
return '-' + grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev')
|
return '-' + grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev')
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user