[PECL-CVS] [pecl-text-xdiff] main: Update Windows CI to be compatible with php/pie

[email protected] (Shivam Mathur) Thu, 9 Apr 2026 05:05:37 +0000
Newsgroups php.pecl.cvs
Message-ID <[email protected]>
Author: Shivam Mathur (shivammathur)
Date: 2026-04-09T10:22:22+05:30

Commit: https://github.com/php/pecl-text-xdiff/commit/04f0b14bdd1f97c5460877e7cfa02220180593ef
Raw diff: https://github.com/php/pecl-text-xdiff/commit/04f0b14bdd1f97c5460877e7cfa02220180593ef.diff

Update Windows CI to be compatible with php/pie

Changed paths:
  D  .github/workflows/build.ps1
  D  .github/workflows/install.ps1
  D  .github/workflows/package.ps1
  D  .github/workflows/test.ps1
  M  .github/workflows/windows.yml


Diff:

diff --git a/.github/workflows/build.ps1 b/.github/workflows/build.ps1
deleted file mode 100644
index d4d9cf8..0000000
--- a/.github/workflows/build.ps1
+++ /dev/null
@@ -1,23 +0,0 @@
-param (
-    [Parameter(Mandatory)] $arch
-)
-
-$ErrorActionPreference = "Stop"
-
-Set-Location ..
-
-$develdir = (Get-Item "php-devel").FullName
-$phpdir = (Get-Item "php").FullName
-$Env:PATH = "$develdir;$phpdir;$Env:PATH"
-
-Set-Location "pecl-text-xdiff"
-
-$task = New-Item "..\task.bat" -Force
-Add-Content $task "call phpize 2>&1"
-Add-Content $task "call configure --with-prefix=$phpdir --with-extra-includes=deps\include --with-extra-libs=deps\lib --enable-debug-pack --with-xdiff"
-Add-Content $task "nmake 2>&1"
-Add-Content $task "exit %errorlevel%"
-& "..\php-sdk\phpsdk-vc15-$arch.bat" -t $task
-if (-not $?) {
-    throw "build failed with errorlevel $LastExitCode"
-}
diff --git a/.github/workflows/install.ps1 b/.github/workflows/install.ps1
deleted file mode 100644
index cf12633..0000000
--- a/.github/workflows/install.ps1
+++ /dev/null
@@ -1,46 +0,0 @@
-param (
-    [Parameter(Mandatory)] $version,
-    [Parameter(Mandatory)] $ts,
-    [Parameter(Mandatory)] $arch,
-    [Parameter(Mandatory)] $libxdiff
-)
-
-$ErrorActionPreference = "Stop"
-
-if ($ts -eq "ts") {
-    $tspart = ""
-} else {
-    $tspart = "-nts";
-}
-
-$releases = Invoke-WebRequest "https://windows.php.net/downloads/releases/releases.json" | ConvertFrom-Json
-$phpversion = $releases.$version.version
-
-Set-Location ..
-
-# SDK
-
-$file = "php-sdk-2.2.0.zip"
-Invoke-WebRequest "https://github.com/microsoft/php-sdk-binary-tools/archive/$file" -OutFile $file
-Expand-Archive $file -DestinationPath .
-Move-Item "php-sdk-binary-tools-php-sdk-2.2.0" -Destination "php-sdk"
-
-# PHP binaries
-
-$file = "php-$phpversion$tspart-Win32-vc15-$arch.zip"
-Invoke-WebRequest "https://windows.php.net/downloads/releases/$file" -OutFile $file
-Expand-Archive $file -DestinationPath "php"
-
-# PHP devel pack
-
-$file = "php-devel-pack-$phpversion$tspart-Win32-vc15-$arch.zip"
-Invoke-WebRequest "https://windows.php.net/downloads/releases/$file" -OutFile $file
-Expand-Archive $file -DestinationPath .
-Move-Item "php-$phpversion-devel-vc15-$arch" -Destination "php-devel"
-
-# libxdiff
-
-$file = "libxdiff-$libxdiff-vc15-$arch.zip"
-Invoke-WebRequest "https://windows.php.net/downloads/pecl/deps/$file" -OutFile $file
-Expand-Archive $file -DestinationPath "deps"
-Move-Item "deps\COPYING" "deps\COPYING.LIBXDIFF"
diff --git a/.github/workflows/package.ps1 b/.github/workflows/package.ps1
deleted file mode 100644
index 8cbf4b1..0000000
--- a/.github/workflows/package.ps1
+++ /dev/null
@@ -1,24 +0,0 @@
-param (
-    [Parameter(Mandatory)] $ts,
-    [Parameter(Mandatory)] $arch
-)
-
-$ErrorActionPreference = "Stop"
-
-if ($arch -eq "x86") {
-    $builddir = "."
-} else {
-    $builddir = "x64"
-}
-$builddir += "\Release"
-if ($ts -eq "ts") {
-    $builddir += "_TS"
-}
-
-$dir = New-Item "windows_package" -ItemType "directory"
-Copy-Item "..\deps\COPYING.LIBXDIFF" -Destination $dir
-Copy-Item "CREDITS" -Destination $dir
-Copy-Item "LICENSE" -Destination $dir
-Copy-Item "README.API" -Destination $dir
-Copy-Item "$builddir\php_xdiff.dll" -Destination $dir
-Copy-Item "$builddir\php_xdiff.pdb" -Destination $dir
diff --git a/.github/workflows/test.ps1 b/.github/workflows/test.ps1
deleted file mode 100644
index 852c0d0..0000000
--- a/.github/workflows/test.ps1
+++ /dev/null
@@ -1,21 +0,0 @@
-param (
-    [Parameter(Mandatory)] $arch
-)
-
-$ErrorActionPreference = "Stop"
-
-Set-Location ..
-
-$develdir = (Get-Item "php-devel").FullName
-$phpdir = (Get-Item "php").FullName
-$Env:PATH = "$develdir;$phpdir;$Env:PATH"
-
-Set-Location "pecl-text-xdiff"
-
-$task = New-Item "..\task.bat" -Force
-Add-Content $task 'nmake test TESTS="--show-diff tests" 2>&1'
-Add-Content $task "exit %errorlevel%"
-& "..\php-sdk\phpsdk-vc15-$arch.bat" -t $task
-if (-not $?) {
-    throw "build failed with errorlevel $LastExitCode"
-}
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index b945729..1f5a5e3 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -1,30 +1,60 @@
 name: Windows build
-on: [push]
+
+on:
+  push:
+    branches: ['**']
+    tags: ['*']
+  pull_request:
+
+permissions:
+  contents: write
+
 jobs:
+  get-extension-matrix:
+    runs-on: ubuntu-latest
+    outputs:
+      matrix: ${{ steps.extension-matrix.outputs.matrix }}
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v6
+
+      - name: Get the extension matrix
+        id: extension-matrix
+        uses: php/php-windows-builder/extension-matrix@v1
+
   build:
+    needs: get-extension-matrix
+    runs-on: ${{ matrix.os }}
     strategy:
-      matrix:
-        version: [7.4, 7.3]
-        ts: [nts, ts]
-        arch: [x64, x86]
-    runs-on: windows-2016
+      matrix: ${{ fromJson(needs.get-extension-matrix.outputs.matrix) }}
+      fail-fast: false
     steps:
       - name: Set git to use LF
         run: |
           git config --global core.autocrlf false
           git config --global core.eol lf
+
       - name: Checkout
-        uses: actions/checkout@v2
-      - name: Install
-        run: ./.github/workflows/install.ps1 -version ${{matrix.version}} -ts ${{matrix.ts}} -arch ${{matrix.arch}} -libxdiff 0.23
-      - name: Build
-        run: ./.github/workflows/build.ps1 -arch ${{matrix.arch}}
-      - name: Package
-        run: ./.github/workflows/package.ps1 -ts ${{matrix.ts}} -arch ${{matrix.arch}}
-      - name: Test
-        run: ./.github/workflows/test.ps1 -arch ${{matrix.arch}}
-      - name: Upload
-        uses: actions/upload-artifact@v2
+        uses: actions/checkout@v6
+
+      - name: Build the extension
+        uses: php/php-windows-builder/extension@v1
+        with:
+          php-version: ${{ matrix.php-version }}
+          arch: ${{ matrix.arch }}
+          ts: ${{ matrix.ts }}
+          libs: libxdiff
+          # Many test work with the same lorem.tmp file, so we need to run them sequentially
+          test-workers: 1
+
+  release:
+    runs-on: ubuntu-latest
+    needs: build
+    if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
+    steps:
+      - name: Upload artifact to the release
+        uses: php/php-windows-builder/release@v1
         with:
-          name: php_xdiff-dev-${{matrix.version}}-${{matrix.ts}}-vc15-${{matrix.arch}}
-          path: windows_package
+          release: ${{ github.ref }}
+          token: ${{ secrets.GITHUB_TOKEN }}
+          draft: 'true'