Skip to content

Commit 33f3991

Browse files
committed
Switch xdebug to latest stable tags
1 parent 82f120b commit 33f3991

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
args: enable-pcov
2626
- extensions: xdebug
2727
repo: xdebug/xdebug
28-
branch: master
28+
branch: latest_stable_tag
2929
dev_branch: master
3030
args: with-xdebug
3131
- extensions: sqlsrv
@@ -85,7 +85,7 @@ jobs:
8585
args: enable-pcov
8686
- extensions: xdebug
8787
repo: xdebug/xdebug
88-
branch: master
88+
branch: latest_stable_tag
8989
dev_branch: master
9090
args: with-xdebug
9191
- extensions: sqlsrv

scripts/builder.ps1

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,32 @@ Function Cleanup() {
5959
New-Item -Path $cache_dir -ItemType "directory"
6060
}
6161

62+
Function Get-LatestGitTag() {
63+
param (
64+
[Parameter(Position = 0, Mandatory = $true)]
65+
[ValidateNotNull()]
66+
[ValidateLength(1, [int]::MaxValue)]
67+
[string]
68+
$repo
69+
)
70+
$lsRemoteOutput = git ls-remote --tags $repo 2>&1
71+
$versionTags = @()
72+
foreach ($line in $lsRemoteOutput -split "`n") {
73+
$line = $line.Trim()
74+
if (-not $line) { continue }
75+
$match = [regex]::Match($line, '\d+\.\d+(?:\.\d+)?(?:\.\d+)?')
76+
if ($match.Success) {
77+
$versionObj = [version]$match.Value
78+
$versionTags += [PSCustomObject]@{
79+
Tag = $match.Value
80+
Version = $versionObj
81+
}
82+
}
83+
}
84+
85+
return ($versionTags | Sort-Object Version -Descending | Select-Object -First 1).Tag
86+
}
87+
6288
Function Get-Extension() {
6389
if ($repo -like "*pecl.php.net*") {
6490
if($branch -eq 'latest') {
@@ -76,8 +102,11 @@ Function Get-Extension() {
76102
Copy-Item -Path "$ext_dir\$extension-$branch\*" -Destination $ext_dir -Recurse -Force
77103
Remove-Item -Path "$ext_dir\$extension-$branch" -Recurse -Force
78104
(Get-Content $ext_dir\config.w32) -replace '/sdl', '' | Set-Content $ext_dir\config.w32
79-
} else {
105+
} else {
80106
if($php -ne $nightly_version) {
107+
if($branch -eq 'latest_stable_tag') {
108+
$branch = Get-LatestGitTag $github/$repo.git
109+
}
81110
git clone --branch=$branch $github/$repo.git $ext_dir
82111
} else {
83112
git clone --branch=$dev_branch $github/$repo.git $ext_dir

0 commit comments

Comments
 (0)