mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-01-19 06:41:44 +07:00
Add extension type in docs workflow
This commit is contained in:
parent
516490f3d1
commit
edf0223f7d
48
.github/workflows/docs.yml
vendored
48
.github/workflows/docs.yml
vendored
@ -22,7 +22,26 @@ jobs:
|
|||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions }}
|
php-version: ${{ matrix.php-versions }}
|
||||||
- name: Create for Linux and macOS
|
- name: Create file with all extensions for Linux and macOS
|
||||||
|
env:
|
||||||
|
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
|
version: ${{ matrix.php-versions }}
|
||||||
|
if: matrix.operating-system != 'windows-2022'
|
||||||
|
run: |
|
||||||
|
php -m >> "$file.all"
|
||||||
|
- name: Create file with all extensions for Windows
|
||||||
|
env:
|
||||||
|
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
|
version: ${{ matrix.php-versions }}
|
||||||
|
if: matrix.operating-system == 'windows-2022'
|
||||||
|
run: |
|
||||||
|
php -m | Out-File -FilePath "$env:file.all" -Append
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: none
|
||||||
|
- name: Create final file for Linux and macOS
|
||||||
env:
|
env:
|
||||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
version: ${{ matrix.php-versions }}
|
version: ${{ matrix.php-versions }}
|
||||||
@ -31,10 +50,20 @@ jobs:
|
|||||||
echo "## PHP $version" >> "$file"
|
echo "## PHP $version" >> "$file"
|
||||||
printf "\n" >> "$file"
|
printf "\n" >> "$file"
|
||||||
echo "\`\`\`" >> "$file"
|
echo "\`\`\`" >> "$file"
|
||||||
php -m >> "$file"
|
php -m >> "$file.builtin"
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [[ $line == [* || -z "${line// }" ]]; then
|
||||||
|
echo "$line" >> "$file"
|
||||||
|
elif grep -q "^$line" "$file.builtin"; then
|
||||||
|
echo "$line (builtin)" >> "$file"
|
||||||
|
else
|
||||||
|
echo "$line (shared)" >> "$file"
|
||||||
|
fi
|
||||||
|
done < "$file.all"
|
||||||
echo "\`\`\`" >> "$file"
|
echo "\`\`\`" >> "$file"
|
||||||
printf "\n" >> "$file"
|
printf "\n" >> "$file"
|
||||||
- name: Create for Windows
|
rm "$file.all" "$file.builtin"
|
||||||
|
- name: Create final file for Windows
|
||||||
env:
|
env:
|
||||||
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
file: php${{ matrix.php-versions }}-${{ matrix.operating-system }}.md
|
||||||
version: ${{ matrix.php-versions }}
|
version: ${{ matrix.php-versions }}
|
||||||
@ -42,8 +71,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
Write-Output "## PHP ${{ matrix.php-versions }}`n" | Out-File -FilePath "$env:file"
|
Write-Output "## PHP ${{ matrix.php-versions }}`n" | Out-File -FilePath "$env:file"
|
||||||
Write-Output "``````" | Out-File -FilePath "$env:file" -Append
|
Write-Output "``````" | Out-File -FilePath "$env:file" -Append
|
||||||
php -m | Out-File -FilePath "$env:file" -Append
|
php -m | Out-File -FilePath "$env:file.builtin" -Append
|
||||||
|
Get-Content "$env:file.all" | ForEach-Object {
|
||||||
|
if ($_.startsWith('[') -or -not $_.trim()) {
|
||||||
|
Write-Output "$_" | Out-File -FilePath "$env:file" -Append
|
||||||
|
} elseif ($_ -in (Get-Content "$env:file.builtin")) {
|
||||||
|
Write-Output "$_ (builtin)" | Out-File -FilePath "$env:file" -Append
|
||||||
|
} else {
|
||||||
|
Write-Output "$_ (shared)" | Out-File -FilePath "$env:file" -Append
|
||||||
|
}
|
||||||
|
}
|
||||||
Write-Output "```````n" | Out-File -FilePath "$env:file" -Append
|
Write-Output "```````n" | Out-File -FilePath "$env:file" -Append
|
||||||
|
Remove-Item "$env:file.all" -Force
|
||||||
|
Remove-Item "$env:file.builtin" -Force
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
Loading…
Reference in New Issue
Block a user