-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.appveyor.yml
More file actions
114 lines (95 loc) · 4.52 KB
/
.appveyor.yml
File metadata and controls
114 lines (95 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
version: "{branch}.build.{build}"
skip_tags: true
branches:
only:
- develop
clone_folder: c:\projects\winbinder
install:
ps: |
echo "Build cache directory c:\build-cache"
if (-not (Test-Path c:\build-cache)) {
mkdir c:\build-cache
}
echo "Download PHP 8 binary tools"
$bname = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER + '.zip'
$bpath = 'php-sdk-' + $env:BIN_SDK_VER
echo "Downloading: https://github.com/php/php-sdk-binary-tools/releases/download/$bpath/$bname"
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "https://github.com/php/php-sdk-binary-tools/releases/download/$bpath/$bname" -OutFile "c:\build-cache\$bname"
}
$dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
$dname1 = 'php-sdk-' + $env:BIN_SDK_VER
if (-not (Test-Path c:\build-cache\$dname1)) {
7z x c:\build-cache\$bname -oc:\build-cache
# Sleep 5 seconds (process cannot access the file)
Start-Sleep -s 5
move c:\build-cache\$dname0 c:\build-cache\$dname1
}
echo "Copy GIT files to SRC build directory"
xcopy c:\projects\winbinder C:\projects\php-src\ext\winbinder\ /s /e /y /f
cache:
c:\build-cache -> .appveyor.yml
environment:
BIN_SDK_VER: 2.3.0
PTHREADS_VER: 2.9.1
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
ARCH: x64
VC: vs17
PHP_VER: 8.4.17
TS: 1
build_script:
ps: |
$ts_part = ''
if ('0' -eq $env:TS) { $ts_part = '-nts' }
$bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
echo "Download PHP8 development pack from release https://downloads.brittainmedia.co.uk/$bname"
$headers = @{
"User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
"Accept" = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
"Accept-Language" = "en-US,en;q=0.5"
"Accept-Encoding" = "gzip, deflate, br"
"Upgrade-Insecure-Requests" = "1"
}
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "https://downloads.brittainmedia.co.uk/$bname" -OutFile "c:\build-cache\$bname" -Headers $headers -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0'
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "https://downloads.brittainmedia.co.uk/$bname" -OutFile "c:\build-cache\$bname" -Headers $headers -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0'
}
}
$dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
$dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
if (-not (Test-Path c:\build-cache\$dname1)) {
7z x c:\build-cache\$bname -oc:\build-cache
# Same directory???
#echo Moving c:\build-cache\$dname0 to c:\build-cache\$dname1
#move c:\build-cache\$dname0 c:\build-cache\$dname1
}
echo "Main build process..."
cd c:\projects\winbinder
$env:PATH = 'c:\build-cache\' + $dname1 + ';' + $env:PATH
echo "" | Out-File -Encoding "ASCII" task.bat
echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
$conf_cmd = 'call configure --with-winbinder=shared --enable-debug 2>&1'
echo $conf_cmd | Out-File -Encoding "ASCII" -Append task.bat
echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
$here = (Get-Item -Path "." -Verbose).FullName
$runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
$task = $here + '\task.bat'
& $runner -t $task
after_build:
ps: |
echo "Build download archive of build extension and save as artifact..."
$ts_part = 'ts'
if ('0' -eq $env:TS) { $ts_part = '-nts' }
$zip_bname = 'php_winbinder-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $ts_part + '-' + $env:VC + '-' + $env:ARCH + '.zip'
$dir = 'c:\projects\winbinder\';
if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
$dir = $dir + 'Release'
if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
& 7z a c:\$zip_bname $dir\php_winbinder.dll
Push-AppveyorArtifact c:\$zip_bname
test_script:
ps: |
echo "Start tests..."