Skip to content

Commit

Permalink
chore(ci): update windows script
Browse files Browse the repository at this point in the history
  • Loading branch information
kjdev committed Nov 25, 2024
1 parent 6192de8 commit 1abf1dc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Add-Content $task 'call phpize 2>&1'
Add-Content $task "call configure --with-php-build=C:\php\deps --enable-$env:PHP_EXT --enable-debug-pack 2>&1"
Add-Content $task 'nmake /nologo 2>&1'
Add-Content $task 'exit %errorlevel%'
& "C:\php\php-sdk-$env:BIN_SDK_VER\phpsdk-$env:VC-$env:ARCH.bat" -t $task
& "C:\php\php-sdk-$env:BIN_SDK_VER\phpsdk-$env:VS-$env:ARCH.bat" -t $task
if (-not $?) {
throw "building failed with errorlevel $LastExitCode"
}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if (-not (Test-Path 'C:\php')) {
# PHP SDK
$bname = "php-sdk-$env:BIN_SDK_VER.zip"
if (-not (Test-Path C:\php\$bname)) {
echo "Download: https://github.com/microsoft/php-sdk-binary-tools/archive/$bname"
Invoke-WebRequest "https://github.com/microsoft/php-sdk-binary-tools/archive/$bname" -OutFile "C:\php\$bname"
echo "Download: https://github.com/php/php-sdk-binary-tools/archive/$bname"
Invoke-WebRequest "https://github.com/php/php-sdk-binary-tools/archive/$bname" -OutFile "C:\php\$bname"
}
$dname0 = "php-sdk-binary-tools-php-sdk-$env:BIN_SDK_VER"
$dname1 = "php-sdk-$env:BIN_SDK_VER"
Expand All @@ -32,7 +32,7 @@ $ts_part = ''
if ('nts' -eq $env:TS) {
$ts_part = '-nts'
}
$bname = "php-devel-pack-$php_version$ts_part-Win32-$env:VC-$env:ARCH.zip"
$bname = "php-devel-pack-$php_version$ts_part-Win32-$env:VS-$env:ARCH.zip"
if (-not (Test-Path "C:\php\$bname")) {
try {
echo "Download: https://windows.php.net/downloads/releases/$bname"
Expand All @@ -42,20 +42,20 @@ if (-not (Test-Path "C:\php\$bname")) {
Invoke-WebRequest "https://windows.php.net/downloads/releases/archives/$bname" -OutFile "C:\php\$bname"
}
}
$dname = "php-$php_version-devel-$env:VC-$env:ARCH"
$dname = "php-$php_version-devel-$env:VS-$env:ARCH"
if (-not (Test-Path "C:\php\devel")) {
Expand-Archive "C:\php\$bname" 'C:\php'
if (-not (Test-Path "C:\php\$dname")) {
$php_normalize_version = $php_version.Split("-")[0]
$dname = "php-$php_normalize_version-devel-$env:VC-$env:ARCH"
$dname = "php-$php_normalize_version-devel-$env:VS-$env:ARCH"
}
if (-not (Test-Path "C:\php\devel")) {
Move-Item "C:\php\$dname" "C:\php\devel"
}
}

# PHP binary: "C:\php\bin"
$bname = "php-$php_version$ts_part-Win32-$env:VC-$env:ARCH.zip"
$bname = "php-$php_version$ts_part-Win32-$env:VS-$env:ARCH.zip"
if (-not (Test-Path "C:\php\$bname")) {
try {
echo "Download: https://windows.php.net/downloads/releases/$bname"
Expand All @@ -70,7 +70,7 @@ if (-not (Test-Path "C:\php\bin")) {
}

# # library dependency: "C:\php\deps"
# $bname = "$env:DEP-$env:VC-$env:ARCH.zip"
# $bname = "$env:DEP-$env:VS-$env:ARCH.zip"
# if (-not (Test-Path "C:\php\$bname")) {
# echo "Download: https://windows.php.net/downloads/pecl/deps/$bname"
# Invoke-WebRequest "https://windows.php.net/downloads/pecl/deps/$bname" -OutFile "C:\php\$bname"
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

env:
PHP_EXT: snappy
BIN_SDK_VER: 2.2.0
BIN_SDK_VER: 2.3.0

jobs:
ci:
Expand All @@ -21,27 +21,27 @@ jobs:
ts:
- 'nts'
- 'ts'
vc:
vs:
- vs16
- vs17
library:
- ''
- 'vcpkg'
exclude:
- php: '8.4'
vc: vs16
vs: vs16
- php: '8.3'
vc: vs17
vs: vs17
- php: '8.2'
vc: vs17
vs: vs17
- php: '8.1'
vc: vs17
vs: vs17

runs-on: ${{ matrix.vc == 'vs17' && 'windows-2022' || 'windows-2019' }}
runs-on: ${{ matrix.vs == 'vs17' && 'windows-2022' || 'windows-2019' }}

env:
PHP_VER: ${{ matrix.php }}
VC: ${{ matrix.vc }}
VS: ${{ matrix.vs }}
ARCH: ${{ matrix.arch }}
TS: ${{ matrix.ts }}

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Store artifact DLL
uses: actions/upload-artifact@v4
with:
name: php_${{ env.PHP_EXT }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vc }}-${{ matrix.arch }}
name: php_${{ env.PHP_EXT }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.vs }}-${{ matrix.arch }}
path: .\php_${{ env.PHP_EXT }}.dll
overwrite: true
if: ${{ matrix.library == '' }}

0 comments on commit 1abf1dc

Please sign in to comment.