1+ #  This workflow assumes that it is in a repository that contains the Xdebug extension source code.
2+ name : Build and Test Xdebug on Windows 
3+ on :
4+   push :
5+   pull_request :
6+   #  When a new release is created, we can build, and upload the DLLs to it.
7+   release :
8+     types : [created] 
9+ jobs :
10+   #  This job generates a matrix of PHP versions, architectures, and thread safety options
11+   #  This is done by reading the constraints from composer.json or the package.xml file.
12+   #  Please refer to https://github.com/php/php-windows-builder#get-the-job-matrix-to-build-a-php-extension
13+   get-extension-matrix :
14+     runs-on : ubuntu-latest 
15+     outputs :
16+       matrix : ${{ steps.extension-matrix.outputs.matrix }} 
17+     steps :
18+       - name : Checkout 
19+         uses : actions/checkout@v5 
20+ 
21+       - name : Get the extension matrix 
22+         id : extension-matrix 
23+         uses : php/php-windows-builder/extension-matrix@v1 
24+ 
25+   #  This job builds the extension on Windows using the matrix generated from the previous job.
26+   build :
27+     needs : get-extension-matrix 
28+     runs-on : ${{ matrix.os }} 
29+     strategy :
30+       matrix : ${{fromJson(needs.get-extension-matrix.outputs.matrix)}} 
31+     steps :
32+       - name : Checkout 
33+         uses : actions/checkout@v5 
34+ 
35+       - name : Build the extension 
36+         uses : php/php-windows-builder/extension@v1 
37+         with :
38+           #  Always specify the php-version, arch, and ts as they are required inputs.
39+           #  Please refer to https://github.com/php/php-windows-builder#build-a-php-extension
40+           php-version : ${{ matrix.php-version }} 
41+           arch : ${{ matrix.arch }} 
42+           ts : ${{ matrix.ts }} 
43+ 
44+           #  Refer to your config.w32 file to find the libraries you need.
45+           #  Refer to the following directories to see if we support the libraries you need.
46+           #  https://downloads.php.net/~windows/pecl/deps
47+           #  https://downloads.php.net/~windows/php-sdk/deps
48+           libs : zlib 
49+ 
50+           #  Refer to your config.w32 file to find the arguments you need to pass to the ./configure step.
51+           #  It will add the --enable-<extension> or --with-<extension> argument if configured in the composer.json file.
52+           #  In this case, we need to add the --with-xdebug argument manually.
53+           args : --with-xdebug 
54+ 
55+   #  This job uploads the built artifacts to the GitHub release.
56+   release :
57+     runs-on : ubuntu-latest 
58+     needs : build 
59+     if : ${{ github.event_name == 'release' }} 
60+     steps :
61+       - name : Upload artifact to the release 
62+         uses : php/php-windows-builder/release@v1 
63+         with :
64+           release : ${{ github.event.release.tag_name }} 
65+           token : ${{ secrets.GITHUB_TOKEN }} 
0 commit comments