Fix release both game version
Some checks failed
forgejo/Czech Quests/addon/pipeline/head There was a failure building this commit
Some checks failed
forgejo/Czech Quests/addon/pipeline/head There was a failure building this commit
This commit is contained in:
parent
84ee045c98
commit
618276c269
1 changed files with 17 additions and 26 deletions
43
Jenkinsfile
vendored
43
Jenkinsfile
vendored
|
@ -36,22 +36,19 @@ def writeToCVersion = { String tocFile, String current, String next ->
|
||||||
writeFile(file: tocFile, text: content)
|
writeFile(file: tocFile, text: content)
|
||||||
}
|
}
|
||||||
|
|
||||||
def generateOutput = { String game ->
|
def createZipFile = { String game ->
|
||||||
|
def tocFile = tocFiles[game]
|
||||||
|
|
||||||
// prepare output folder
|
// prepare output folder
|
||||||
sh "mkdir -p $outputFolder"
|
sh "mkdir -p $outputFolder"
|
||||||
|
|
||||||
// copy toc file
|
// copy toc file
|
||||||
def tocFile = tocFiles[game]
|
|
||||||
sh "cp $tocFile $outputFolder"
|
sh "cp $tocFile $outputFolder"
|
||||||
|
|
||||||
// copy files
|
// copy files
|
||||||
sh "find . -name '*.lua' -exec rsync -av {} $outputFolder \\;"
|
sh "find . -name '*.lua' -exec rsync -av {} $outputFolder \\;"
|
||||||
sh "find . -name '*.tga' -exec rsync -av {} $outputFolder \\;"
|
sh "find . -name '*.tga' -exec rsync -av {} $outputFolder \\;"
|
||||||
sh "find . -name '*.ttf' -exec rsync -av {} $outputFolder \\;"
|
sh "find . -name '*.ttf' -exec rsync -av {} $outputFolder \\;"
|
||||||
}
|
|
||||||
|
|
||||||
def createReleaseFile = { String game ->
|
|
||||||
def tocFile = tocFiles[game]
|
|
||||||
|
|
||||||
// get version
|
// get version
|
||||||
def currentVersion = readToCVersion(tocFile)
|
def currentVersion = readToCVersion(tocFile)
|
||||||
|
@ -66,15 +63,18 @@ def createReleaseFile = { String game ->
|
||||||
|
|
||||||
// save version
|
// save version
|
||||||
writeToCVersion(tocFile, currentVersion, newVersion)
|
writeToCVersion(tocFile, currentVersion, newVersion)
|
||||||
|
}
|
||||||
|
|
||||||
// commit new version
|
def pushToGit = { String game ->
|
||||||
def tag = "v$newVersion"
|
def tocFile = tocFiles[game]
|
||||||
|
def version = readToCVersion(tocFile)
|
||||||
|
def tag = "v$version"
|
||||||
sh "git checkout ${BRANCH_NAME}"
|
sh "git checkout ${BRANCH_NAME}"
|
||||||
sh "git add $tocFile"
|
sh "git add *.toc"
|
||||||
sh "git commit -m 'Release ${tag}'"
|
sh "git commit -m 'Release $tag'"
|
||||||
sh "git push"
|
sh "git push"
|
||||||
sh "git tag ${tag}"
|
sh "git tag $tag"
|
||||||
sh "git push origin ${tag}"
|
sh "git push origin $tag"
|
||||||
}
|
}
|
||||||
|
|
||||||
MasterJob [:], { ->
|
MasterJob [:], { ->
|
||||||
|
@ -88,25 +88,16 @@ MasterJob [:], { ->
|
||||||
stageWhen('build') {
|
stageWhen('build') {
|
||||||
def game = params.GAME
|
def game = params.GAME
|
||||||
if (game == "all") {
|
if (game == "all") {
|
||||||
generateOutput("classic_era")
|
createZipFile("classic_era")
|
||||||
generateOutput("retail")
|
createZipFile("retail")
|
||||||
} else {
|
} else {
|
||||||
generateOutput(game)
|
createZipFile(game)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stageWhen('make release') {
|
|
||||||
def game = params.GAME
|
|
||||||
forgejoGit()
|
forgejoGit()
|
||||||
if (game == "all") {
|
pushToGit(game)
|
||||||
createReleaseFile("classic_era")
|
|
||||||
createReleaseFile("retail")
|
|
||||||
} else {
|
|
||||||
createReleaseFile(game)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stageWhen('upload release') {
|
stageWhen('release') {
|
||||||
def game = params.GAME
|
def game = params.GAME
|
||||||
def tocFile = tocFiles[game]
|
def tocFile = tocFiles[game]
|
||||||
def version = readToCVersion(tocFile)
|
def version = readToCVersion(tocFile)
|
||||||
|
|
Loading…
Add table
Reference in a new issue