mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-04-13 11:15:43 +02:00
Remove experimental TC releases
This commit is contained in:
parent
3d1b502cd0
commit
c9b25cbb27
.teamcity/_Self
buildTypes
subprojects
scripts
@ -1,72 +0,0 @@
|
||||
/*
|
||||
* 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.buildFeatures.sshAgent
|
||||
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 releases/x.y.z
|
||||
branches=${'$'}(git branch -r | grep -oE 'releases/[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", "")
|
||||
}
|
||||
|
||||
features {
|
||||
sshAgent {
|
||||
teamcitySshKey = "IdeaVim ssh keys"
|
||||
}
|
||||
}
|
||||
})
|
42
.teamcity/_Self/buildTypes/PrintReleaseBranch.kt
vendored
42
.teamcity/_Self/buildTypes/PrintReleaseBranch.kt
vendored
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* 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 _Self.vcsRoots.ReleasesVcsRoot
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.sshAgent
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script
|
||||
|
||||
object PrintReleaseBranch : IdeaVimBuildType({
|
||||
name = "EXP: Print release branch"
|
||||
|
||||
vcs {
|
||||
root(ReleasesVcsRoot)
|
||||
branchFilter = "+:heads/releases/*"
|
||||
|
||||
checkoutMode = CheckoutMode.AUTO
|
||||
}
|
||||
|
||||
steps {
|
||||
|
||||
script {
|
||||
name = "Print current branch"
|
||||
scriptContent = """
|
||||
echo "Current branch is: %teamcity.build.branch%"
|
||||
""".trimIndent()
|
||||
}
|
||||
}
|
||||
|
||||
features {
|
||||
sshAgent {
|
||||
teamcitySshKey = "IdeaVim ssh keys"
|
||||
}
|
||||
}
|
||||
})
|
110
.teamcity/_Self/buildTypes/ReleaseEapFromBranch.kt
vendored
110
.teamcity/_Self/buildTypes/ReleaseEapFromBranch.kt
vendored
@ -1,110 +0,0 @@
|
||||
package _Self.buildTypes
|
||||
|
||||
import _Self.Constants.EAP_CHANNEL
|
||||
import _Self.Constants.RELEASE_EAP
|
||||
import _Self.IdeaVimBuildType
|
||||
import _Self.vcsRoots.ReleasesVcsRoot
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.ParameterDisplay
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.sshAgent
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric
|
||||
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange
|
||||
|
||||
object ReleaseEapFromBranch : IdeaVimBuildType({
|
||||
name = "EXP: Publish EAP Build from branch"
|
||||
description = "Build and publish EAP of IdeaVim plugin"
|
||||
|
||||
artifactRules = "build/distributions/*"
|
||||
|
||||
params {
|
||||
param("env.ORG_GRADLE_PROJECT_ideaVersion", RELEASE_EAP)
|
||||
password(
|
||||
"env.ORG_GRADLE_PROJECT_publishToken",
|
||||
"credentialsJSON:61a36031-4da1-4226-a876-b8148bf32bde",
|
||||
label = "Password"
|
||||
)
|
||||
param("env.ORG_GRADLE_PROJECT_publishChannels", EAP_CHANNEL)
|
||||
password(
|
||||
"env.ORG_GRADLE_PROJECT_slackUrl",
|
||||
"credentialsJSON:a8ab8150-e6f8-4eaf-987c-bcd65eac50b5",
|
||||
label = "Slack Token"
|
||||
)
|
||||
password(
|
||||
"env.YOUTRACK_TOKEN",
|
||||
"credentialsJSON:2479995b-7b60-4fbb-b095-f0bafae7f622",
|
||||
display = ParameterDisplay.HIDDEN
|
||||
)
|
||||
}
|
||||
|
||||
vcs {
|
||||
root(ReleasesVcsRoot)
|
||||
branchFilter = """
|
||||
+:heads/releases/*
|
||||
""".trimIndent()
|
||||
|
||||
checkoutMode = CheckoutMode.AUTO
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
name = "Pull git tags"
|
||||
scriptContent = "git fetch --tags origin"
|
||||
}
|
||||
script {
|
||||
name = "Pull git history"
|
||||
scriptContent = "git fetch --unshallow"
|
||||
}
|
||||
gradle {
|
||||
name = "Calculate new eap version from branch"
|
||||
tasks = "scripts:calculateNewEapVersionFromBranch"
|
||||
jdkHome = "/usr/lib/jvm/java-21-amazon-corretto"
|
||||
}
|
||||
gradle {
|
||||
name = "Set TeamCity build number"
|
||||
tasks = "scripts:setTeamCityBuildNumber"
|
||||
jdkHome = "/usr/lib/jvm/java-21-amazon-corretto"
|
||||
}
|
||||
gradle {
|
||||
name = "Add release tag"
|
||||
tasks = "scripts:addReleaseTag"
|
||||
jdkHome = "/usr/lib/jvm/java-21-amazon-corretto"
|
||||
}
|
||||
gradle {
|
||||
name = "Publish plugin"
|
||||
tasks = "publishPlugin"
|
||||
jdkHome = "/usr/lib/jvm/java-21-amazon-corretto"
|
||||
}
|
||||
script {
|
||||
name = "Push changes to the repo"
|
||||
scriptContent = """
|
||||
branch=$(git branch --show-current)
|
||||
echo current branch is ${'$'}branch
|
||||
git push origin %build.number%
|
||||
""".trimIndent()
|
||||
}
|
||||
gradle {
|
||||
name = "YouTrack post release actions"
|
||||
tasks = "scripts:eapReleaseActions"
|
||||
}
|
||||
}
|
||||
|
||||
features {
|
||||
sshAgent {
|
||||
teamcitySshKey = "IdeaVim ssh keys"
|
||||
}
|
||||
}
|
||||
|
||||
failureConditions {
|
||||
failOnMetricChange {
|
||||
metric = BuildFailureOnMetric.MetricType.ARTIFACT_SIZE
|
||||
threshold = 5
|
||||
units = BuildFailureOnMetric.MetricUnit.PERCENTS
|
||||
comparison = BuildFailureOnMetric.MetricComparison.DIFF
|
||||
compareTo = build {
|
||||
buildRule = lastSuccessful()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
7
.teamcity/_Self/subprojects/Releases.kt
vendored
7
.teamcity/_Self/subprojects/Releases.kt
vendored
@ -1,11 +1,8 @@
|
||||
package _Self.subprojects
|
||||
|
||||
import _Self.buildTypes.CreateNewReleaseBranchFromMaster
|
||||
import _Self.buildTypes.PrintReleaseBranch
|
||||
import _Self.buildTypes.PublishVimEngine
|
||||
import _Self.buildTypes.ReleaseDev
|
||||
import _Self.buildTypes.ReleaseEap
|
||||
import _Self.buildTypes.ReleaseEapFromBranch
|
||||
import _Self.buildTypes.ReleaseMajor
|
||||
import _Self.buildTypes.ReleaseMinor
|
||||
import _Self.buildTypes.ReleasePatch
|
||||
@ -41,8 +38,4 @@ object Releases : Project({
|
||||
buildType(ReleaseEap)
|
||||
buildType(ReleaseDev)
|
||||
buildType(PublishVimEngine)
|
||||
|
||||
buildType(CreateNewReleaseBranchFromMaster)
|
||||
buildType(PrintReleaseBranch)
|
||||
buildType(ReleaseEapFromBranch)
|
||||
})
|
||||
|
@ -107,13 +107,6 @@ tasks.register("calculateNewEapVersion", JavaExec::class) {
|
||||
args = listOf("${rootProject.rootDir}")
|
||||
}
|
||||
|
||||
tasks.register("calculateNewEapVersionFromBranch", JavaExec::class) {
|
||||
group = "release"
|
||||
mainClass.set("scripts.release.CalculateNewEapVersionFromBranchKt")
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
args = listOf("${rootProject.rootDir}")
|
||||
}
|
||||
|
||||
tasks.register("calculateNewDevVersion", JavaExec::class) {
|
||||
group = "release"
|
||||
mainClass.set("scripts.release.CalculateNewDevVersionKt")
|
||||
|
@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2023 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 scripts.release
|
||||
|
||||
fun main(args: Array<String> ) {
|
||||
val projectDir = args[0]
|
||||
println("Working directory: $projectDir")
|
||||
val branch = withRepo(projectDir) { it.branch }
|
||||
val (majorBranchVersion, minorBranchVersion) = versions(branch)
|
||||
val versions = getVersionsExistingVersionsFor(majorBranchVersion, minorBranchVersion, projectDir)
|
||||
val maxExistingVersion = versions.keys.maxOrNull()
|
||||
|
||||
val nextVersion = if (maxExistingVersion != null) {
|
||||
if (maxExistingVersion.suffixTokens.isEmpty()) {
|
||||
maxExistingVersion.nextPatch().withSuffix("eap.1").value
|
||||
}
|
||||
else {
|
||||
check(maxExistingVersion.suffixTokens.size == 2) {
|
||||
"We should have exactly two suffix tokens. Current tokens: ${maxExistingVersion.suffixTokens.toList()}"
|
||||
}
|
||||
check(maxExistingVersion.suffixTokens[0] == "eap") {
|
||||
"First suffix token must be eap. Current tokens: ${maxExistingVersion.suffixTokens.toList()}"
|
||||
}
|
||||
|
||||
val newEapNumber = maxExistingVersion.suffixTokens[1].toInt().inc()
|
||||
maxExistingVersion.withSuffix("eap.$newEapNumber").value
|
||||
}
|
||||
} else {
|
||||
"$majorBranchVersion.$minorBranchVersion.0-eap.1"
|
||||
}
|
||||
|
||||
|
||||
println("Next eap version: $nextVersion")
|
||||
println("##teamcity[setParameter name='env.ORG_GRADLE_PROJECT_version' value='$nextVersion']")
|
||||
}
|
||||
|
||||
private val regex = "releases/(\\d+)\\.(\\d+)\\.x".toRegex()
|
||||
private fun versions(branchName: String): Pair<Int, Int> {
|
||||
val match = regex.matchEntire(branchName) ?: error("Cannot match branch: $branchName")
|
||||
val major = match.groups[1]
|
||||
val minor = match.groups[2]
|
||||
return major!!.value.toInt() to minor!!.value.toInt()
|
||||
}
|
Loading…
Reference in New Issue
Block a user