Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Update Kendo, Themes, DPL, Captcha, Icons and Licensing versions"

on:
workflow_dispatch:
inputs:
new_kendo_version:
description: "The new Kendo version to apply"
type: string
required: true

new_themes_version:
description: "The new themes version to apply"
type: string
required: true

new_dpl_versions:
description: "The new dpl versions to apply"
type: string
required: true

new_icons_version:
description: "The new icon versions to apply"
type: string
required: true

new_captcha_version:
description: "The Web Captcha version to apply"
type: string
required: true

new_licensing_version:
description: "The new licensing version to apply"
type: string
required: true
jobs:
update-versions:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

env:
new_kendo_version: ${{ github.event.inputs.new_kendo_version }}
new_themes_version: ${{ github.event.inputs.new_themes_version }}
new_dpl_versions: ${{ github.event.inputs.new_themes_version }}
new_icons_version: ${{ github.event.inputs.new_icons_version }}
new_captcha_version: ${{ github.event.inputs.new_captcha_version }}
new_licensing_version: ${{ github.event.inputs.new_licensing_version }}

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update dependencies
shell: pwsh
run: |
./scripts/update_versions.ps1 -newKendoVersion "$env:new_kendo_version" -newThemesVersion "$env:new_themes_version" -newDplVersion "$env:new_dpl_versions" -newIconsVersion "$env:new_icons_version" -newCaptchaVersion "$env:new_captcha_version" -newLicensingVersion "$env:new_licensing_version"

- name: Create PR
run: |
git checkout -b ${{ inputs.new_kendo_version }}
git config user.email "[email protected]"
git config user.name "kendo-bot"
git add .
git status
git commit -m "chore: update kendo, themes, dpl, captcha, icons and licensing versions"
git push --set-upstream origin ${{ inputs.new_kendo_version }}
gh pr create --base master --head ${{ inputs.new_kendo_version }} --title "Update dependencies" --body "Updated kendo, themes, dpl, captcha, icons and licensing versions"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
195 changes: 195 additions & 0 deletions scripts/update_versions.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
param(
[string]$newKendoVersion = "2025.4.1111",
[string]$newThemesVersion = "12.0.1",
[string]$newDplVersion = "2025.3.807",
[string]$newIconsVersion = "4.7.0",
[string]$newCaptchaVersion = "2.0.4",
[string]$newLicensingVersion = "1.6.17"
)

function Replace_Reference{
param(
[string]$fileContent,
[string]$oldReference,
[string]$newReference
)

if($fileContent -match $oldReference) {
$fileContent = $fileContent -replace $oldReference, $newReference
}

return $fileContent
}

function UpdateDplPackagesInConfig {
param (
[string] $packageContent,
[string[]] $dplPackages
)

foreach($dplPackage in $dplPackages) {
$packageContent = Replace_Reference -fileContent $packageContent -oldReference "<package id=""${dplPackage}"" version=""(.+?)""" -newReference "<package id=""${dplPackage}"" version=""${newDplVersion}"""
}

return $packageContent
}

function UpdateIconPackagesInConfig {
param (
[string] $packageContent,
[string[]] $iconPackages
)

foreach($iconPackage in $iconPackages) {
$packageContent = Replace_Reference -fileContent $packageContent -oldReference "<package id=""${iconPackage}"" version=""(.+?)""" -newReference "<package id=""${iconPackage}"" version=""${newIconsVersion}"""
}

return $packageContent
}

function Update_PackagesConfig {
param (
[string[]] $packagesConfigPathsToUpdate
)

foreach($packagesPath in $packagesConfigPathsToUpdate) {
if(Test-Path $packagesPath) {
$packageContent = Get-Content -Path $packagesPath -Raw

$packageContent = UpdateDplPackagesInConfig -packageContent $packageContent -dplPackages $dplPackages
$packageContent = UpdateIconPackagesInConfig -packageContent $packageContent -iconPackages $iconPackages

$packageContent = Replace_Reference -fileContent $packageContent -oldReference "<package id=""Telerik.Web.Captcha"" version=""(.+?)""" -newReference "<package id=""Telerik.Web.Captcha"" version=""${newCaptchaVersion}"""
$packageContent = Replace_Reference -fileContent $packageContent -oldReference "<package id=""Telerik.Licensing"" version=""(.+?)""" -newReference "<package id=""Telerik.Licensing"" version=""${newLicensingVersion}"""
$packageContent = Replace_Reference -fileContent $packageContent -oldReference "<package id=""Telerik.UI.for.AspNet.Mvc5.Lite"" version=""(.+?)""" -newReference "<package id=""Telerik.UI.for.AspNet.Mvc5.Lite"" version=""${newKendoVersion}"""

$packageContent | Set-Content -Path $packagesPath -NoNewline
}
}
}

function Update_LayoutVersions {
param (
[string[]]$layoutPathsToUpdate
)


foreach($layoutPath in $layoutPathsToUpdate) {
if(Test-Path $layoutPath) {

$layoutFileContent = Get-Content -Path $layoutPath -Raw

if($layoutFileContent -match "var kendoVersion(\W\D+)(\d+.\d.\d+)(\W+)") {
$layoutFileContent = $layoutFileContent -replace "var kendoVersion(\W\D+)(\d+.\d.\d+)(\W+)", "var kendoVersion = ""$newKendoVersion"";`n "
}

if($layoutFileContent -match "var themeVersion(\W\D+)(\d+.\d.\d+)(\W+)") {
$layoutFileContent = $layoutFileContent -replace "var themeVersion(\W\D+)(\d+.\d.\d+)(\W+)", "var themeVersion = ""$newThemesVersion"";`n "
}

$layoutFileContent | Set-Content -Path $layoutPath -NoNewline
}

}

}

function Update_DplProjectReferences {
param(
[string]$projectContent,
[string[]]$dplPackages
)

foreach($dplPackage in $dplPackages) {
$projectContent = Replace_Reference -fileContent $projectContent -oldReference "<Reference Include=""${dplPackage}, Version=(\d+.\d.\d+)" -newReference "<Reference Include=""${dplPackage}, Version=${newDplVersion}"
$projectContent = Replace_Reference -fileContent $projectContent "..\\packages\\${dplPackage}.(\d+).(\d+).(\d+)" -newReference "..\packages\${dplPackage}.${newDplVersion}"
}

return $projectContent
}

function Update_LicensingProjectReferences {
param(
[string]$projectContent
)

$projectContent = Replace_Reference -fileContent $projectContent -oldReference "<Reference Include=""Telerik.Licensing.Runtime, Version=(\d+.\d.\d+)" -newReference "<Reference Include=""Telerik.Licensing.Runtime, Version=${newLicensingVersion}"
$projectContent = Replace_Reference -fileContent $projectContent -oldReference "..\\packages\\Telerik.Licensing.(\d+).(\d+).(\d+)" -newReference "..\packages\Telerik.Licensing.${newLicensingVersion}"


return $projectContent
}

function Update_IconsProjectReferences {
param(
[string]$projectContent,
[string[]]$iconPackages
)

foreach($iconPackage in $iconPackages) {
$projectContent = Replace_Reference -fileContent $projectContent -oldReference "<Reference Include=""${iconPackage}, Version=(\d+.\d.\d+)" -newReference "<Reference Include=""${iconPackage}, Version=${newIconsVersion}"
$projectContent = Replace_Reference -fileContent $projectContent "..\\packages\\${iconPackage}.(\d+).(\d+).(\d+)" -newReference "..\packages\${iconPackage}.${newIconsVersion}"
}

return $projectContent
}

function Update_ProjectVersions {
param (
[string[]]$csprojPathsToUpdate
)

foreach($csprojPath in $csprojPathsToUpdate) {
if(Test-Path $csprojPath) {

$projectContent = Get-Content -Path $csprojPath -Raw

$projectContent = Update_DplProjectReferences -projectContent $projectContent -dplPackages $dplPackages
$projectContent = Update_IconsProjectReferences -projectContent $projectContent -iconPackages $iconPackages
$projectContent = Update_LicensingProjectReferences -projectContent $projectContent


$projectContent = Replace_Reference -fileContent $projectContent -oldReference "<Reference Include=""Telerik.Web.Captcha, Version=(\d+.\d+.\d+)" -newReference "<Reference Include=""Telerik.Web.Captcha, Version=${newCaptchaVersion}"
$projectContent = Replace_Reference -fileContent $projectContent "..\\packages\\Telerik.Web.Captcha.(\d+).(\d+).(\d+)" -newReference "..\packages\Telerik.Web.Captcha.${newCaptchaVersion}"

$projectContent = Replace_Reference -fileContent $projectContent -oldReference "<Reference Include=""Kendo.Mvc, Version=(\d+.\d+.\d+)" -newReference "<Reference Include=""Kendo.Mvc, Version=${newKendoVersion}"
$projectContent = Replace_Reference -fileContent $projectContent "..\\packages\\Telerik.UI.for.AspNet.Mvc5.Lite.(\d+).(\d+).(\d+)" -newReference "..\packages\Telerik.UI.for.AspNet.Mvc5.Lite.${newKendoVersion}"


$projectContent | Set-Content -Path $csprojPath -NoNewline
}

}
}

$layoutPathsToUpdate = @(
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\Views\Shared\_Layout.cshtml'
)

$csprojPathsToUpdate = @(
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\Telerik.Examples.Mvc.csproj'
)

$packagesConfigPathsToUpdate = @(
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\packages.config'
)

$dplPackages = @(
'Telerik.Documents.Core',
'Telerik.Documents.Core',
'Telerik.Documents.Fixed',
'Telerik.Documents.ImageUtils',
'Telerik.Windows.Documents.Core',
'Telerik.Windows.Documents.Flow',
'Telerik.Windows.Zip',
'Telerik.Zip'
)

$iconPackages = @(
'Telerik.FontIcons',
'Telerik.SvgIcons'
)

Update_LayoutVersions -layoutPathsToUpdate $layoutPathsToUpdate
Update_PackagesConfig -packagesConfigPathsToUpdate $packagesConfigPathsToUpdate
Update_ProjectVersions -csprojPathsToUpdate $csprojPathsToUpdate