Skip to content

Commit

Permalink
Add PHP 8.5 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Sep 26, 2024
1 parent 0564948 commit 6976a50
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 19 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/php83.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
New-Item -ItemType "directory" -Path C:\php-snap-build
cd C:\php-snap-build
git clone https://github.com/php/php-sdk-binary-tools.git php-sdk
git clone https://github.com/php/web-rmtools.git rmtools
git clone https://github.com/shivammathur/web-rmtools.git rmtools
New-Item -ItemType "directory" -Path C:\php-snap-build\${{ matrix.target }}
New-Item -ItemType "directory" -Path C:\php-snap-build\snap_83\vs16\${{ matrix.arch }}
Copy-Item -Path C:\php-snap-build\rmtools\bin\rmtools_setvars.bat-dist -Destination C:\php-snap-build\rmtools\bin\rmtools_setvars.bat
Expand Down Expand Up @@ -74,11 +74,6 @@ jobs:
$branch_script_location="C:\php-snap-build\rmtools\include\Branch.php"
$config_location="C:\php-snap-build\rmtools\data\config\branch\${{ matrix.arch }}\php83.ini"
# Patch to add PHP 8.3 config
$config_dir="C:\php-snap-build\rmtools\data\config\branch\${{ matrix.arch }}"
Copy-Item -Path $config_dir\php82.ini -Destination $config_location
((Get-Content -path $config_location -Raw) -replace "8.2", "8.3") | Set-Content -Path $config_location
((Get-Content -path $git_script_location -Raw) -replace "c:\\apps\\git\\bin\\git.exe", $git_location) | Set-Content -Path $git_script_location
((Get-Content -path $git_script_location -Raw) -replace "c:\\apps\\git\\bin\\tar.exe", $tar_location) | Set-Content -Path $git_script_location
((Get-Content -path $task_location -Raw) -replace ">> %LOG_FILE% 2<&1", "") | Set-Content -Path $task_location
Expand Down
139 changes: 139 additions & 0 deletions .github/workflows/php84.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: 'Build PHP 8.4'
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '30 23 * * *'
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip-8.4')"
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: x64
target: obj-x64
config: nts-windows-vs17-x64
- arch: x64
target: obj-x64
config: ts-windows-vs17-x64
- arch: x64
target: obj-x64
config: nts-windows-vs17-x64-avx
- arch: x86
target: obj
config: nts-windows-vs17-x86
- arch: x86
target: obj
config: ts-windows-vs17-x86
name: Build PHP
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@develop
with:
php-version: 8.4
ini-values: disable_functions=mail
- name: Test PHP
run: php -v
- name: Test php extensions
run: php -m
- name: Create Build Environment
run: |
New-Item -ItemType "directory" -Path C:\php-snap-build
cd C:\php-snap-build
git clone https://github.com/php/php-sdk-binary-tools.git php-sdk
git clone https://github.com/shivammathur/web-rmtools.git rmtools
New-Item -ItemType "directory" -Path C:\php-snap-build\${{ matrix.target }}
New-Item -ItemType "directory" -Path C:\php-snap-build\snap_84\vs17\${{ matrix.arch }}
Copy-Item -Path C:\php-snap-build\rmtools\bin\rmtools_setvars.bat-dist -Destination C:\php-snap-build\rmtools\bin\rmtools_setvars.bat
Copy-Item -Path C:\php-snap-build\rmtools\data\config\credentials_ftps.php-dist -Destination C:\php-snap-build\rmtools\data\config\credentials_ftps.php
- name: Add InstantClient
run: |
$oci_dir="C:/php-snap-build/deps_aux/oracle/${{ matrix.arch }}"
New-Item -ItemType "directory" -Path $oci_dir
$suffix = 'windows'
if ('${{ matrix.arch }}' -eq 'x86') {
$suffix = 'nt'
}
Invoke-WebRequest -UseBasicParsing -Uri https://download.oracle.com/otn_software/nt/instantclient/instantclient-basiclite-$suffix.zip -OutFile $oci_dir\instantclient.zip
Invoke-WebRequest -UseBasicParsing -Uri https://download.oracle.com/otn_software/nt/instantclient/instantclient-sdk-$suffix.zip -OutFile $oci_dir\sdk.zip
Expand-Archive -Path $oci_dir\instantclient.zip -DestinationPath $oci_dir -Force
Expand-Archive -Path $oci_dir\sdk.zip -DestinationPath $oci_dir -Force
Get-ChildItem $oci_dir -Filter 'instantclient*' | ?{ $_.PSIsContainer } | Rename-Item -NewName instantclient_19_9
- name: Patch Tools
run: |
$git_location="C:\Program Files\Git\cmd\git.exe"
$tar_location="C:\Program Files\Git\usr\bin\tar.exe"
$task_location="C:\php-snap-build\rmtools\bin\snapshot_task.bat"
$git_script_location="C:\php-snap-build\rmtools\include\Git.php"
$snap_script_location="C:\php-snap-build\rmtools\script\snap.php"
$branch_script_location="C:\php-snap-build\rmtools\include\Branch.php"
$config_location="C:\php-snap-build\rmtools\data\config\branch\${{ matrix.arch }}\php84.ini"
((Get-Content -path $git_script_location -Raw) -replace "c:\\apps\\git\\bin\\git.exe", $git_location) | Set-Content -Path $git_script_location
((Get-Content -path $git_script_location -Raw) -replace "c:\\apps\\git\\bin\\tar.exe", $tar_location) | Set-Content -Path $git_script_location
((Get-Content -path $task_location -Raw) -replace ">> %LOG_FILE% 2<&1", "") | Set-Content -Path $task_location
((Get-Content -path $snap_script_location -Raw) -replace "0, 7", "0, 10") | Set-Content -Path $snap_script_location
((Get-Content -path $branch_script_location -Raw) -replace "0, 7", "0, 10") | Set-Content -Path $branch_script_location
((Get-Content -path $config_location -Raw) -replace "pgo=1", "pgo=0") | Set-Content -Path $config_location
- name: build PHP
run: |
C:\php-snap-build\php-sdk\bin\vswhere
$ErrorActionPreference = "Stop"
& C:\php-snap-build\php-sdk\phpsdk-vs17-${{ matrix.arch }}.bat -t C:\php-snap-build\rmtools\bin\snapshot_task.bat --task-args "php84 ${{ matrix.config }}"
- name: Collect Artifacts
run: |
New-Item -ItemType "directory" -Path builds
Get-ChildItem C:\php-snap-build\${{ matrix.target }}\* -Recurse -Include php-*.zip | Foreach-Object { Copy-Item -Path $_ -Destination .\builds }
Copy-Item -Path C:\php-snap-build\rmtools\data\db\PHP-8.4.json -Destination .\builds\${{ matrix.config }}.json
if((Get-ChildItem .\builds\*.zip).Count -lt 5) {
exit 1
}
$php_version = Invoke-RestMethod https://raw.githubusercontent.com/php/php-src/PHP-8.4/main/php_version.h | Where-Object { $_ -match 'PHP_VERSION "(.*)"' } | Foreach-Object {$Matches[1]}
(Get-Content .\builds\${{ matrix.config }}.json | ConvertFrom-Json).revision_last > COMMIT
Get-ChildItem .\builds\* -Include ("php-$php_version*.zip", "php-master*.zip") | Foreach-Object { Compress-Archive -update COMMIT $_ }
Get-ChildItem .\builds\*.zip | Foreach-Object {
if ($_.Name -match '.*(rc|RC)\d*-dev.*') {
Copy-Item -Path $_ -Destination (Join-Path -Path builds -ChildPath ($_.Name -replace '(rc|RC)\d+', '')) -Force
}
}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config }}
path: builds
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create builds directory
run: mkdir builds

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: builds

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install cloudsmith-cli
run: pip install --upgrade cloudsmith-cli

- name: Release
run: bash scripts/release.sh
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
GITHUB_MESSAGE: ${{ github.event.head_commit.message }}
GITHUB_RELEASES: php8.4
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 11 additions & 11 deletions .github/workflows/phpmaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ on:
- cron: '30 23 * * *'
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip-8.4')"
runs-on: windows-2019
if: "!contains(github.event.head_commit.message, 'skip-8.5')"
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- arch: x64
target: obj-x64
config: nts-windows-vs16-x64
config: nts-windows-vs17-x64
- arch: x64
target: obj-x64
config: ts-windows-vs16-x64
config: ts-windows-vs17-x64
- arch: x64
target: obj-x64
config: nts-windows-vs16-x64-avx
config: nts-windows-vs17-x64-avx
- arch: x86
target: obj
config: nts-windows-vs16-x86
config: nts-windows-vs17-x86
- arch: x86
target: obj
config: ts-windows-vs16-x86
config: ts-windows-vs17-x86
name: Build PHP
steps:
- name: Checkout
Expand All @@ -48,7 +48,7 @@ jobs:
git clone https://github.com/php/php-sdk-binary-tools.git php-sdk
git clone https://github.com/shivammathur/web-rmtools.git rmtools
New-Item -ItemType "directory" -Path C:\php-snap-build\${{ matrix.target }}
New-Item -ItemType "directory" -Path C:\php-snap-build\snap_master\vs16\${{ matrix.arch }}
New-Item -ItemType "directory" -Path C:\php-snap-build\snap_master\vs17\${{ matrix.arch }}
Copy-Item -Path C:\php-snap-build\rmtools\bin\rmtools_setvars.bat-dist -Destination C:\php-snap-build\rmtools\bin\rmtools_setvars.bat
Copy-Item -Path C:\php-snap-build\rmtools\data\config\credentials_ftps.php-dist -Destination C:\php-snap-build\rmtools\data\config\credentials_ftps.php
- name: Add InstantClient
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
run: |
C:\php-snap-build\php-sdk\bin\vswhere
$ErrorActionPreference = "Stop"
& C:\php-snap-build\php-sdk\phpsdk-vs16-${{ matrix.arch }}.bat -t C:\php-snap-build\rmtools\bin\snapshot_task.bat --task-args "phpmaster ${{ matrix.config }}"
& C:\php-snap-build\php-sdk\phpsdk-vs17-${{ matrix.arch }}.bat -t C:\php-snap-build\rmtools\bin\snapshot_task.bat --task-args "phpmaster ${{ matrix.config }}"
- name: Collect Artifacts
run: |
$php_version = Invoke-RestMethod https://raw.githubusercontent.com/php/php-src/master/main/php_version.h | Where-Object { $_ -match 'PHP_VERSION "(.*)"' } | Foreach-Object {$Matches[1]}
Expand All @@ -92,7 +92,7 @@ jobs:
Copy-Item -Path builds -Destination master -Container -Recurse
Copy-Item -Path C:\php-snap-build\rmtools\data\db\master.json -Destination .\builds\${{ matrix.config }}.json
Get-ChildItem .\master *.zip | Rename-Item -NewName { $_.name -replace "win32","windows" }
if(("${{ matrix.config }}" -eq "ts-windows-vs16-x64") -or ("${{ matrix.config }}" -eq "ts-windows-vs16-x86")) {
if(("${{ matrix.config }}" -eq "ts-windows-vs17-x64") -or ("${{ matrix.config }}" -eq "ts-windows-vs17-x86")) {
Get-ChildItem .\master *.zip | Rename-Item -NewName { $_.name -replace $php_version,"master-ts" }
} else {
Get-ChildItem .\master *.zip | Rename-Item -NewName { $_.name -replace $php_version,"master" }
Expand Down Expand Up @@ -136,6 +136,6 @@ jobs:
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
GITHUB_MESSAGE: ${{ github.event.head_commit.message }}
GITHUB_RELEASES: php8.4 master
GITHUB_RELEASES: php8.5 master
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ The following configurations are built nightly.
- `debug-pack`, `devel=pack` for each configuration.
- `test pack` for the version.

### PHP 8.4.0-dev/master
### PHP 8.5.0-dev/master
[https://github.com/shivammathur/php-builder-windows/releases/tag/php8.5](https://github.com/shivammathur/php-builder-windows/releases/tag/php8.5)

### PHP 8.4.0-dev
[https://github.com/shivammathur/php-builder-windows/releases/tag/php8.4](https://github.com/shivammathur/php-builder-windows/releases/tag/php8.4)

### PHP 8.3.0-dev
Expand All @@ -39,7 +42,7 @@ To install a PHP snapshot, open an elevated PowerShell session and run these com
$php_dir = 'C:\tools\php' # Set this as per your setup
$arch = 'x64' # Set x64 or x86
$ts = $False # Set $False for nts or $True for ts
$version = '8.3' # Set 8.0, 8.1, 8.2, 8.3, o4 8.4
$version = '8.4' # Set 8.0, 8.1, 8.2, 8.3, 8.4, or 8.5
# Install
New-Item -Path $php_dir -Type Directory -Force
Expand Down

0 comments on commit 6976a50

Please sign in to comment.