Remove GAME parameter from Jenkins and set same versions
All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good

This commit is contained in:
Roman Jaroš 2025-03-08 16:16:16 +01:00
parent cc59976f0a
commit 53c5c1dc9f
3 changed files with 17 additions and 33 deletions

View file

@ -2,7 +2,7 @@
## Title: CzechQuests ## Title: CzechQuests
## Notes: Addon displays texts of quests in Czech language ## Notes: Addon displays texts of quests in Czech language
## Author: Roman Jaroš ## Author: Roman Jaroš
## Version: 0.2.15 ## Version: 1.0.0
## SavedVariables: CzechQuestsAddon_Store ## SavedVariables: CzechQuestsAddon_Store
## Category: Translations ## Category: Translations
## IconTexture: Interface\AddOns\CzechQuests\Assets\Icons\Logo ## IconTexture: Interface\AddOns\CzechQuests\Assets\Icons\Logo

View file

@ -2,7 +2,7 @@
## Title: CzechQuests ## Title: CzechQuests
## Notes: Addon displays texts of quests in Czech language as tooltip ## Notes: Addon displays texts of quests in Czech language as tooltip
## Author: Roman Jaroš ## Author: Roman Jaroš
## Version: 0.1.16 ## Version: 1.0.0
## SavedVariables: CzechQuestsAddon_Store ## SavedVariables: CzechQuestsAddon_Store
CzechQuests.lua CzechQuests.lua

46
Jenkinsfile vendored
View file

@ -7,25 +7,21 @@ def SKIP = "skip"
properties([parameters([ properties([parameters([
choice( choice(
name: 'RELEASE', name: 'RELEASE',
choices: ['patch', 'minor', 'major'], choices: [SKIP, 'patch', 'minor', 'major'],
description: 'Release new version' description: 'Release new version'
), ),
choice(
name: 'GAME',
choices: [SKIP, 'classic_era', 'retail', 'all'],
description: 'Create build with manual tag',
)
])]) ])])
def outputFolder = "CzechQuests" def outputFolder = "CzechQuests"
def tocFiles = [ def tocFiles = [
"classic_era": "CzechQuests_Vanilla.toc", "classic_era": "CzechQuests_Vanilla.toc",
"retail" : "CzechQuests_Mainline.toc" "retail" : "CzechQuests_Mainline.toc"
] ]
def readToCVersion = { String tocFile -> def readToCVersion = { ->
return sh( return sh(
script: "grep '## Version:' $tocFile | cut -d ' ' -f 3", script: "grep '## Version:' ${tocFiles['classic_era']} | cut -d ' ' -f 3",
returnStdout: true returnStdout: true
).trim() ).trim()
} }
@ -51,7 +47,7 @@ def createZipFile = { String game ->
sh "find . -name '*.ttf' -exec rsync -av {} $outputFolder \\;" sh "find . -name '*.ttf' -exec rsync -av {} $outputFolder \\;"
// get version // get version
def currentVersion = readToCVersion(tocFile) def currentVersion = readToCVersion()
def newVersion = ReleaseUtils.increaseVersion(currentVersion, params.RELEASE) def newVersion = ReleaseUtils.increaseVersion(currentVersion, params.RELEASE)
// create zip // create zip
@ -65,9 +61,8 @@ def createZipFile = { String game ->
writeToCVersion(tocFile, currentVersion, newVersion) writeToCVersion(tocFile, currentVersion, newVersion)
} }
def pushToGit = { String game -> def pushToGit = { ->
def tocFile = tocFiles[game] def version = readToCVersion()
def version = readToCVersion(tocFile)
def tag = "v$version" def tag = "v$version"
sh "git checkout ${BRANCH_NAME}" sh "git checkout ${BRANCH_NAME}"
sh "git add *.toc" sh "git add *.toc"
@ -77,14 +72,14 @@ def pushToGit = { String game ->
sh "git push origin $tag" sh "git push origin $tag"
} }
def uploadToForgejo = { String game -> def uploadToForgejo = { ->
def tocFile = tocFiles[game] def version = readToCVersion()
def version = readToCVersion(tocFile)
ForgejoRelease('czech-quests', 'addon', version) ForgejoRelease('czech-quests', 'addon', version)
} }
MasterJob [:], { -> MasterJob [:], { ->
if (game == SKIP) { def version = params.RELEASE
if (version == SKIP) {
currentBuild.result = 'SUCCESS' currentBuild.result = 'SUCCESS'
return return
} }
@ -92,24 +87,13 @@ MasterJob [:], { ->
checkout scm checkout scm
stageWhen('build') { stageWhen('build') {
def game = params.GAME createZipFile("classic_era")
if (game == "all") { createZipFile("retail")
createZipFile("classic_era")
createZipFile("retail")
} else {
createZipFile(game)
}
forgejoGit() forgejoGit()
pushToGit(game) pushToGit()
} }
stageWhen('release') { stageWhen('release') {
def game = params.GAME uploadToForgejo()
if (game == "all") {
uploadToForgejo("classic_era")
uploadToForgejo("retail")
} else {
uploadToForgejo(game)
}
} }
} }