@@ -11,19 +11,6 @@ permissions:
1111 issues : write
1212
1313jobs :
14- get-extension-matrix :
15- runs-on : ubuntu-latest
16- outputs :
17- matrix : ${{ steps.extension-matrix.outputs.matrix }}
18- steps :
19- - name : Checkout
20- uses : actions/checkout@v4
21- - name : Get the extension matrix
22- id : extension-matrix
23- uses : php/php-windows-builder/extension-matrix@v1
24- with :
25- php-version-list : ' 8.2, 8.3, 8.4'
26-
2714 build-linux :
2815 runs-on : ubuntu-latest
2916 strategy :
@@ -101,92 +88,14 @@ jobs:
10188 compression-level : 6
10289 overwrite : true
10390 include-hidden-files : false
104-
105- build-windows :
106- needs : get-extension-matrix
107- runs-on : ${{ matrix.os }}
108- strategy :
109- fail-fast : false
110- matrix : ${{fromJson(needs.get-extension-matrix.outputs.matrix)}}
111- steps :
112- - name : Checkout
113- uses : actions/checkout@v4
114- with :
115- submodules : true
116-
117- - name : Initialize and update submodules
118- run : |
119- git submodule update --init --recursive
120-
121- - name : Verify submodule files
122- run : |
123- echo "Checking if lib directory and files exist:"
124- dir lib
125- echo "Checking specific source files:"
126- if (Test-Path "lib\arena.c") { echo "arena.c exists" } else { echo "arena.c missing" }
127- if (Test-Path "lib\csv_config.c") { echo "csv_config.c exists" } else { echo "csv_config.c missing" }
128- if (Test-Path "lib\csv_reader.c") { echo "csv_reader.c exists" } else { echo "csv_reader.c missing" }
129- if (Test-Path "lib\csv_writer.c") { echo "csv_writer.c exists" } else { echo "csv_writer.c missing" }
130- if (Test-Path "lib\csv_parser.c") { echo "csv_parser.c exists" } else { echo "csv_parser.c missing" }
131- if (Test-Path "lib\csv_utils.c") { echo "csv_utils.c exists" } else { echo "csv_utils.c missing" }
132- shell : pwsh
133-
134- - name : Build The Extension
135- uses : php/php-windows-builder/extension@v1
136- with :
137- php-version : ${{ matrix.php-version }}
138- arch : ${{ matrix.arch }}
139- ts : ${{ matrix.ts }}
140-
141- - name : Create dist directory
142- run : mkdir -p dist/releases/${{ github.ref_name }}/windows/php${{ matrix.php-version }}-${{ matrix.arch }}
143-
144- - name : Copy extension
145- shell : pwsh
146- run : |
147- $dllPaths = @(
148- "Release_TS\php_fastcsv.dll",
149- "x64\Release_TS\php_fastcsv.dll",
150- "Release\php_fastcsv.dll",
151- "x64\Release\php_fastcsv.dll",
152- "modules\php_fastcsv.dll"
153- )
154-
155- $found = $false
156- foreach ($path in $dllPaths) {
157- if (Test-Path $path) {
158- Write-Host "Found extension at: $path"
159- Copy-Item "$path" "dist/releases/${{ github.ref_name }}/windows/php${{ matrix.php-version }}-${{ matrix.arch }}/fastcsv.dll"
160- $found = $true
161- break
162- }
163- }
164-
165- if (-not $found) {
166- Write-Host "ERROR: Could not find php_fastcsv.dll in any expected locations:"
167- $dllPaths | ForEach-Object { Write-Host " Checked: $_" }
168- Write-Host "Available DLL files:"
169- Get-ChildItem -Recurse -Filter "*.dll" | Select-Object FullName
170- exit 1
171- }
172-
173- - name : Upload artifact
174- uses : actions/upload-artifact@v4
175- with :
176- name : windows-builds-php${{ matrix.php-version }}-${{ matrix.arch }}-${{ matrix.ts }}
177- path : dist/releases/${{ github.ref_name }}/windows/php${{ matrix.php-version }}-${{ matrix.arch }}
178- if-no-files-found : warn
179- compression-level : 6
180- overwrite : true
181- include-hidden-files : false
18291
18392 create-release :
184- needs : [build-linux, build-macos, build-windows ]
93+ needs : [build-linux, build-macos]
18594 runs-on : ubuntu-latest
18695 steps :
18796 - name : Create release directories
18897 run : |
189- mkdir -p dist/releases/${{ github.ref_name }}/{linux,macos,windows, final}
98+ mkdir -p dist/releases/${{ github.ref_name }}/{linux,macos,final}
19099
191100 - name : Download all artifacts
192101 uses : actions/download-artifact@v4
@@ -203,8 +112,8 @@ jobs:
203112 run : |
204113 echo "=== Starting file preparation ==="
205114
206- echo "Looking for .so and .dll files..."
207- find dist/releases/${{ github.ref_name }} -name "*.so" -o -name "*.dll"
115+ echo "Looking for .so files..."
116+ find dist/releases/${{ github.ref_name }} -name "*.so"
208117
209118 echo "=== Processing Linux builds ==="
210119 for artifact_dir in dist/releases/${{ github.ref_name }}/linux-builds-php*; do
@@ -229,21 +138,6 @@ jobs:
229138 done
230139 fi
231140 done
232-
233- echo "=== Processing Windows builds ==="
234- for artifact_dir in dist/releases/${{ github.ref_name }}/windows-builds-php*; do
235- if [ -d "$artifact_dir" ]; then
236- artifact_name=$(basename "$artifact_dir")
237- php_ver=$(echo "$artifact_name" | grep -o 'php[0-9]\.[0-9]' | sed 's/php//')
238- arch=$(echo "$artifact_name" | grep -o 'x64')
239- ts=$(echo "$artifact_name" | grep -o '\(ts\|nts\)$')
240- echo "Processing Windows artifact directory: $artifact_dir for PHP $php_ver ($arch-$ts)"
241- for file in $(find "$artifact_dir" -name "*.dll"); do
242- echo "Found Windows build: $file"
243- cp -v "$file" "dist/releases/${{ github.ref_name }}/final/fastcsv-windows-php${php_ver}-${arch}-${ts}.dll"
244- done
245- fi
246- done
247141
248142 echo "=== Files ready for release ==="
249143 ls -la dist/releases/${{ github.ref_name }}/final/ || echo "No files in final directory"
@@ -257,7 +151,6 @@ jobs:
257151 files : |
258152 dist/releases/${{ github.ref_name }}/final/fastcsv-linux-php*.so
259153 dist/releases/${{ github.ref_name }}/final/fastcsv-macos-php*.so
260- dist/releases/${{ github.ref_name }}/final/fastcsv-windows-php*.dll
261154 name : Release ${{ github.ref_name }}
262155 body : |
263156 ## FastCSV Extension ${{ github.ref_name }}
@@ -273,18 +166,10 @@ jobs:
273166 - PHP 8.2: `fastcsv-macos-php8.2.so`
274167 - PHP 8.3: `fastcsv-macos-php8.3.so`
275168 - PHP 8.4: `fastcsv-macos-php8.4.so`
276-
277- #### Windows:
278- - PHP 8.2 (x64-TS): `fastcsv-windows-php8.2-x64-ts.dll`
279- - PHP 8.2 (x64-NTS): `fastcsv-windows-php8.2-x64-nts.dll`
280- - PHP 8.3 (x64-TS): `fastcsv-windows-php8.3-x64-ts.dll`
281- - PHP 8.3 (x64-NTS): `fastcsv-windows-php8.3-x64-nts.dll`
282- - PHP 8.4 (x64-TS): `fastcsv-windows-php8.4-x64-ts.dll`
283- - PHP 8.4 (x64-NTS): `fastcsv-windows-php8.4-x64-nts.dll`
284169
285170 ### Installation
286171 1. Download the appropriate file for your platform and PHP version
287- 2. Rename the downloaded file to `fastcsv.so` (Linux/macOS) or `fastcsv.dll` (Windows)
172+ 2. Rename the downloaded file to `fastcsv.so`
288173 3. Copy the renamed file to your PHP extensions directory:
289174 ```bash
290175 # Find your PHP extension directory
@@ -295,8 +180,7 @@ jobs:
295180 ```
296181 4. Add to your php.ini:
297182 ```ini
298- extension=fastcsv.so # Linux/macOS
299- extension=fastcsv.dll # Windows
183+ extension=fastcsv.so
300184 ```
301185 5. Restart your PHP service/server
302186
0 commit comments