1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-04-09 17:15:50 +02:00

Add testing TC job for calculating new version of the release

This commit is contained in:
Alex Plate 2024-05-28 19:05:37 +03:00
parent 9296c3f9a0
commit 33c4905dcb
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
2 changed files with 68 additions and 0 deletions
.teamcity/_Self

View File

@ -0,0 +1,65 @@
/*
* Copyright 2003-2024 The IdeaVim authors
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE.txt file or at
* https://opensource.org/licenses/MIT.
*/
package _Self.buildTypes
import _Self.IdeaVimBuildType
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
import jetbrains.buildServer.configs.kotlin.v2019_2.DslContext
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script
object CreateNewReleaseBranchFromMaster : IdeaVimBuildType({
name = "EXP: Create new release branch from master"
vcs {
root(DslContext.settingsRoot)
branchFilter = "+:<default>"
checkoutMode = CheckoutMode.AUTO
}
steps {
script {
name = "Calculate next potential release version"
scriptContent = """
#!/bin/bash
# Fetch all remote branches
git fetch --all
# Get a list of all branches matching the pattern release/x.y.z
branches=${'$'}(git branch -r | grep -oE 'release/[0-9]+\.[0-9]+\.x')
# If no matching branches are found, print a message and exit
if [[ -z "${'$'}branches" ]]; then
echo "No release branches found"
exit 1
fi
# Find the largest release version
largest_release=${'$'}(echo "${'$'}branches" | sort -V | tail -n 1)
# Print the largest release
echo "Largest release branch: ${'$'}largest_release"
echo "##teamcity[setParameter name='env.POTENTIAL_VERSION' value='${'$'}largest_release']"
""".trimIndent()
}
script {
name = "Show potential release version"
scriptContent = """
#!/bin/bash
echo "Calculated or user-provided parameter value is: %env.POTENTIAL_VERSION%"
""".trimIndent()
}
}
params {
param("env.POTENTIAL_VERSION", "")
}
})

View File

@ -1,5 +1,6 @@
package _Self.subprojects
import _Self.buildTypes.CreateNewReleaseBranchFromMaster
import _Self.buildTypes.PublishVimEngine
import _Self.buildTypes.ReleaseDev
import _Self.buildTypes.ReleaseEap
@ -38,4 +39,6 @@ object Releases : Project({
buildType(ReleaseEap)
buildType(ReleaseDev)
buildType(PublishVimEngine)
buildType(CreateNewReleaseBranchFromMaster)
})