File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,6 +139,22 @@ def writeModrinthBodyFile = { String text ->
139139 return outFile
140140}
141141
142+ def determineModrinthVersionType = { String releaseTag ->
143+ if (! releaseTag) return ' alpha'
144+ def tagLower = releaseTag. toLowerCase()
145+ if (tagLower. contains(' snapshot' ) || tagLower. contains(' dev' ) || tagLower. contains(' alpha' ) || tagLower. matches(/ v?\d +\.\d +(-?a|alpha).*/ )) {
146+ return ' alpha'
147+ }
148+ if (tagLower. contains(' beta' ) || tagLower. matches(/ v?\d +\.\d +(-?b|beta).*/ )) {
149+ return ' beta'
150+ }
151+ if (tagLower. contains(' rc' ) || tagLower. matches(/ v?\d +\.\d +(-?rc).*/ )) {
152+ return ' beta'
153+ }
154+
155+ return ' release'
156+ }
157+
142158modrinth {
143159 token = System . getenv(" MODRINTH_TOKEN" )
144160 projectId = " noctisui"
@@ -149,7 +165,10 @@ modrinth {
149165 loaders = [" fabric" ]
150166
151167 def modrinthBody = fetchReleaseDescription(tag)
152- syncBodyFrom = writeModrinthBodyFile(modrinthBody). absolutePath
168+ syncBodyFrom = writeModrinthBodyFile(modrinthBody)
169+
170+ versionType = determineModrinthVersionType(tag)
171+ logger. lifecycle(" modrinth: determined versionType=${ versionType} for tag=${ tag} " )
153172}
154173
155174tasks. register(' printModrinthBody' ) {
You can’t perform that action at this time.
0 commit comments