Skip to content

Commit fea903b

Browse files
committed
chore: add automate telerik version update
1 parent 6d44cf4 commit fea903b

File tree

2 files changed

+148
-0
lines changed

2 files changed

+148
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "Update Kendo, Themes, Core Export, Web PDF, Web Captcha, and Web Spreadsheet versions"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
old_kendo_version:
7+
description: "The old Kendo version to replace"
8+
type: string
9+
required: true
10+
new_kendo_version:
11+
description: "The new Kendo version to apply"
12+
type: string
13+
required: true
14+
15+
old_themes_version:
16+
description: "The old themes version to apply"
17+
type: string
18+
required: true
19+
20+
new_themes_version:
21+
description: "The new themes version to apply"
22+
type: string
23+
required: true
24+
25+
old_web_captcha_version:
26+
description: "The old Web Captcha version to apply"
27+
type: string
28+
required: true
29+
30+
new_web_captcha_version:
31+
description: "The new Web Captcha version to apply"
32+
type: string
33+
required: true
34+
35+
old_common_web_versions:
36+
description: "The old common Web versions to apply"
37+
type: string
38+
required: true
39+
40+
new_common_web_versions:
41+
description: "The new common Web versions to apply"
42+
type: string
43+
required: true
44+
45+
jobs:
46+
update-versions:
47+
runs-on: ubuntu-latest
48+
49+
permissions:
50+
pull-requests: write
51+
52+
env:
53+
old_kendo_version: ${{ github.event.inputs.old_kendo_version }}
54+
new_kendo_version: ${{ github.event.inputs.new_kendo_version }}
55+
old_themes_version: ${{ github.event.inputs.old_themes_version }}
56+
new_themes_version: ${{ github.event.inputs.new_themes_version }}
57+
old_common_web_versions: ${{ github.event.inputs.old_common_web_versions }}
58+
new_common_web_versions: ${{ github.event.inputs.new_common_web_versions }}
59+
old_web_captcha_version: ${{ github.event.inputs.old_web_captcha_version }}
60+
new_web_captcha_version: ${{ github.event.inputs.new_web_captcha_version }}
61+
62+
steps:
63+
- name: Checkout repo
64+
uses: actions/checkout@v4
65+
66+
- name: Update dependencies
67+
shell: pwsh
68+
run: |
69+
./scripts/update_versions.ps1 -oldKendoVersion "$env:old_kendo_version" -newKendoVersion "$env:new_kendo_version" -oldThemesVersion "$env:old_themes_version" -newThemesVersion "$env:new_themes_version" -oldWebCaptchaVersion "$env:old_web_captcha_version" -newWebCaptchaVersion "$env:new_web_captcha_version" -oldCommonWebVersions "$old_common_web_versions" -newCommonWebVersions "$env:new_common_web_versions"
70+
71+
- name: Create PR
72+
run: |
73+
git checkout -b ${{ inputs.new_kendo_version }}
74+
git config user.email "kendo-bot@progress.com"
75+
git config user.name "kendo-bot"
76+
git add .
77+
git status
78+
git commit -m "chore: update kendo, themes, export, pdf, and captcha versions"
79+
git push --set-upstream origin ${{ inputs.new_kendo_version }}
80+
gh pr create --base master --head ${{ inputs.new_kendo_version }} --title "Update dependencies" --body "Updated kendo, themes, export, pdf, and captcha versions"

scripts/update_versions.ps1

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
param(
2+
[string]$oldKendoVersion = "2025.3.825",
3+
[string]$newKendoVersion = "2025.4.1111",
4+
5+
[string]$oldThemesVersion = "12.0.0",
6+
[string]$newThemesVersion = "12.0.1",
7+
8+
9+
[string]$oldWebCaptchaVersion = "2.0.3",
10+
[string]$newWebCaptchaVersion = "2.0.4",
11+
12+
[string]$oldCommonWebVersions = "2025.3.812",
13+
[string]$newCommonWebVersions = "2025.3.813"
14+
)
15+
16+
function Replace_Reference{
17+
param(
18+
[string]$path,
19+
[string]$oldReference,
20+
[string]$newReference
21+
)
22+
23+
(Get-Content -Path $path) |
24+
ForEach-Object {$_ -Replace $oldReference , $newReference} |
25+
Set-Content -Path $path
26+
}
27+
28+
function Update_LayoutVersions {
29+
param (
30+
[string[]]$layoutPathsToUpdate
31+
)
32+
33+
34+
foreach($layoutPath in $layoutPathsToUpdate) {
35+
Replace_Reference -path $layoutPath -oldReference $oldKendoVersion -newReference $newKendoVersion
36+
Replace_Reference -path $layoutPath -oldReference $oldThemesVersion -newReference $newThemesVersion
37+
}
38+
39+
}
40+
41+
function Update_ProjectVersions {
42+
param (
43+
[string[]]$csprojPathsToUpdate
44+
)
45+
46+
foreach($csprojPath in $csprojPathsToUpdate) {
47+
Replace_Reference -path $csprojPath -oldReference $oldKendoVersion -newReference $newKendoVersion
48+
Replace_Reference -path $csprojPath -oldReference "Include=""Telerik.Web.Captcha"" Version=""$oldWebCaptchaVersion""" -newReference "Include=""Telerik.Web.Captcha"" Version=""$newWebCaptchaVersion"""
49+
Replace_Reference -path $csprojPath -oldReference "Include=""Telerik.Web.PDF"" Version=""$oldCommonWebVersions""" -newReference "Include=""Telerik.Web.PDF"" Version=""$newWebPDFVersion"""
50+
Replace_Reference -path $csprojPath -oldReference "Include=""Telerik.Web.Spreadsheet"" Version=""$oldCommonWebVersions""" -newReference "Include=""Telerik.Web.Spreadsheet"" Version=""$newCommonWebVersions"""
51+
Replace_Reference -path $csprojPath -oldReference "Include=""Telerik.Core.Export"" Version=""$oldCommonWebVersions""" -newReference "Include=""Telerik.Core.Export"" Version=""$newCommonWebVersions"""
52+
}
53+
}
54+
55+
$layoutPathsToUpdate = @(
56+
'Telerik.Examples.ContentSecurityPolicy\Views\Shared\_Layout.cshtml',
57+
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\Views\Shared\_Layout.cshtml',
58+
'Telerik.Examples.RazorPages\Telerik.Examples.RazorPages\Pages\Shared\_Layout.cshtml'
59+
)
60+
61+
$csprojPathsToUpdate = @(
62+
'Telerik.Examples.ContentSecurityPolicy\Telerik.Examples.ContentSecurityPolicy.csproj',
63+
'Telerik.Examples.RazorPages\Telerik.Examples.RazorPages\Telerik.Examples.RazorPages.csproj',
64+
'Telerik.Examples.Mvc\Telerik.Examples.Mvc\Telerik.Examples.Mvc.csproj'
65+
)
66+
67+
Update_LayoutVersions -layoutPathsToUpdate $layoutPathsToUpdate
68+
Update_ProjectVersions -csprojPathsToUpdate $csprojPathsToUpdate

0 commit comments

Comments
 (0)