Skip to content

Commit 6d2e80f

Browse files
committed
Lowercase refs in pecl artifacts
1 parent fb5fcd7 commit 6d2e80f

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

.github/workflows/pecl.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,19 @@ jobs:
101101
- name: Release
102102
env:
103103
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
REF: ${{ inputs.extension-ref }}
105+
URL: ${{ inputs.extension-url }}
106+
REPO: ${{ github.repository }}
104107
run: |
105108
ls -l artifacts
106-
extension=$(basename "${{ inputs.extension-url }}")
107-
mkdir -p /tmp/$extension/${{ inputs.extension-ref }}/
108-
cp -a artifacts/* /tmp/$extension/${{ inputs.extension-ref }}/
109+
ref=$(echo "$REF" | tr "[:upper:]" "[:lower:]")
110+
extension=$(basename "$URL")
111+
mkdir -p /tmp/$extension/$ref/
112+
cp -a artifacts/* /tmp/$extension/$ref/
109113
cd /tmp || exit 1
110-
zip -r $extension-${{ inputs.extension-ref }}.zip $extension
111-
if ! gh release view pecl -R ${{ github.repository }}; then
112-
gh release create pecl $extension-${{ inputs.extension-ref }}.zip -t pecl -n pecl -R ${{ github.repository }}
114+
zip -r $extension-$ref.zip $extension
115+
if ! gh release view pecl -R $REPO; then
116+
gh release create pecl $extension-$ref.zip -t pecl -n pecl -R $REPO
113117
else
114-
gh release upload pecl $extension-${{ inputs.extension-ref }}.zip -R ${{ github.repository }} --clobber
118+
gh release upload pecl $extension-$ref.zip -R $REPO --clobber
115119
fi

extension/BuildPhpExtension/private/Add-Package.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,21 @@ function Add-Package {
4848
Copy-Item -Path $pdbFilePath -Destination artifacts -Force
4949
}
5050
}
51-
# TODO: Filter these using deplister
51+
5252
if(Test-Path ..\deps\bin) {
53-
Get-ChildItem -Path ..\deps\bin -Recurse -Include "*.dll", "*.pdb" | ForEach-Object {
54-
if(-not(Test-Path "php-bin\$($_.Name.Split('.')[0]).dll")) {
55-
if($_.Extension -eq ".dll" -or (Test-Path ([IO.Path]::ChangeExtension($_.FullName, "dll")))) {
53+
$dllMap = Invoke-WebRequest -Uri "https://downloads.php.net/~windows/pecl/deps/dllmapping.json"
54+
Get-ChildItem -Path ..\deps\bin -Recurse -Include "*.dll" | ForEach-Object {
55+
if($dllMap.content.Contains($_.Name)) {
56+
if(-not(Test-Path "php-bin\$($_.Name)")) {
5657
Copy-Item -Path $_.FullName -Destination artifacts -Force
5758
}
5859
}
5960
}
61+
Get-ChildItem -Path ..\deps\bin -Recurse -Include "*.pdb" | ForEach-Object {
62+
if(Test-Path "artifacts\$($_.Name.Split('.')[0]).dll") {
63+
Copy-Item -Path $_.FullName -Destination artifacts -Force
64+
}
65+
}
6066
if(Test-Path (Join-Path -Path ..\deps\bin -ChildPath "*.xml")) {
6167
New-Item -ItemType Directory -Path artifacts\config -Force | Out-Null
6268
Get-ChildItem -Path ..\deps\bin -Recurse -Filter "*.xml" | ForEach-Object {
@@ -87,7 +93,7 @@ function Add-Package {
8793
}
8894
}
8995
} else {
90-
$artifact = "php_$($Config.package_name)-$($Config.ref)-$($Config.php_version)-$($Config.ts)-$($Config.vs_version)-$arch"
96+
$artifact = "php_$($Config.package_name)-$($Config.ref.ToLower())-$($Config.php_version)-$($Config.ts)-$($Config.vs_version)-$arch"
9197
}
9298

9399
7z a -sdel "$artifact.zip" *

extension/BuildPhpExtension/private/Invoke-Build.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ Function Invoke-Build {
2626

2727
$builder = "php-sdk\phpsdk-$($Config.vs_version)-$($Config.Arch).bat"
2828
$task = (Get-Item -Path "." -Verbose).FullName + '\task.bat'
29+
$ref = $Config.ref
30+
if($env:ARTIFACT_NAMING_SCHEME -ne 'pie') {
31+
$ref = $Config.ref.ToLower()
32+
}
2933
$suffix = "php_" + (@(
3034
$Config.name,
31-
$Config.ref,
35+
$ref,
3236
$Config.php_version,
3337
$Config.ts,
3438
$Config.vs_version,

0 commit comments

Comments
 (0)