Skip to content

Commit 93982c5

Browse files
author
brittain
committed
appveyor
1 parent cacd37e commit 93982c5

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

.appveyor.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
version: "{branch}.build.{build}"
2+
skip_tags: true
3+
4+
branches:
5+
only:
6+
- develop
7+
8+
clone_folder: c:\projects\wcli
9+
10+
install:
11+
ps: |
12+
13+
echo "Build cache directory c:\build-cache"
14+
if (-not (Test-Path c:\build-cache)) {
15+
mkdir c:\build-cache
16+
}
17+
18+
echo "Download PHP 8 binary tools"
19+
$bname = 'php-sdk-' + $env:BIN_SDK_VER + '.zip'
20+
if (-not (Test-Path c:\build-cache\$bname)) {
21+
Invoke-WebRequest "https://github.com/OSTC/php-sdk-binary-tools/archive/$bname" -OutFile "c:\build-cache\$bname"
22+
}
23+
$dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
24+
$dname1 = 'php-sdk-' + $env:BIN_SDK_VER
25+
if (-not (Test-Path c:\build-cache\$dname1)) {
26+
7z x c:\build-cache\$bname -oc:\build-cache
27+
# Sleep 5 seconds (process cannot access the file)
28+
Start-Sleep -s 5
29+
move c:\build-cache\$dname0 c:\build-cache\$dname1
30+
}
31+
32+
echo "Copy GIT files to SRC build directory"
33+
xcopy c:\projects\wcli C:\projects\php-src\ext\wcli\ /s /e /y /f
34+
35+
cache:
36+
c:\build-cache -> .appveyor.yml
37+
38+
environment:
39+
BIN_SDK_VER: 2.2.0
40+
PTHREADS_VER: 2.9.1
41+
matrix:
42+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
43+
ARCH: x64
44+
VC: vs16
45+
PHP_VER: 8.3.8
46+
TS: 1
47+
48+
build_script:
49+
ps: |
50+
51+
$ts_part = ''
52+
if ('0' -eq $env:TS) { $ts_part = '-nts' }
53+
$bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
54+
echo "Download PHP8 development pack from release http://windows.php.net/downloads/releases/archives/$bname"
55+
if (-not (Test-Path c:\build-cache\$bname)) {
56+
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname" -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0'
57+
if (-not (Test-Path c:\build-cache\$bname)) {
58+
Invoke-WebRequest "http://windows.php.net/downloads/archives/releases/$bname" -OutFile "c:\build-cache\$bname" -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0'
59+
}
60+
}
61+
62+
$dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
63+
$dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
64+
if (-not (Test-Path c:\build-cache\$dname1)) {
65+
7z x c:\build-cache\$bname -oc:\build-cache
66+
# Same directory???
67+
#echo Moving c:\build-cache\$dname0 to c:\build-cache\$dname1
68+
#move c:\build-cache\$dname0 c:\build-cache\$dname1
69+
}
70+
71+
echo "Main build process..."
72+
cd c:\projects\wcli
73+
74+
$env:PATH = 'c:\build-cache\' + $dname1 + ';' + $env:PATH
75+
echo "" | Out-File -Encoding "ASCII" task.bat
76+
echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
77+
$conf_cmd = 'call configure --with-wcli=shared --enable-debug 2>&1'
78+
echo $conf_cmd | Out-File -Encoding "ASCII" -Append task.bat
79+
echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
80+
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
81+
$here = (Get-Item -Path "." -Verbose).FullName
82+
$runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
83+
$task = $here + '\task.bat'
84+
& $runner -t $task
85+
86+
after_build:
87+
ps: |
88+
89+
echo "Build download archive of build extension and save as artifact..."
90+
$ts_part = 'ts'
91+
if ('0' -eq $env:TS) { $ts_part = '-nts' }
92+
$zip_bname = 'php_wcli-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $ts_part + '-' + $env:VC + '-' + $env:ARCH + '.zip'
93+
$dir = 'c:\projects\wcli\';
94+
if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
95+
$dir = $dir + 'Release'
96+
if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
97+
& 7z a c:\$zip_bname $dir\php_wcli.dll
98+
Push-AppveyorArtifact c:\$zip_bname
99+
100+
test_script:
101+
ps: |
102+
103+
echo "Start tests..."

0 commit comments

Comments
 (0)