|
| 1 | +version: "{branch}.build.{build}" |
| 2 | +skip_tags: true |
| 3 | + |
| 4 | +branches: |
| 5 | + only: |
| 6 | + - master |
| 7 | + |
| 8 | +clone_folder: c:\projects\ast |
| 9 | + |
| 10 | +install: |
| 11 | + ps: | |
| 12 | + if (-not (Test-Path c:\build-cache)) { |
| 13 | + mkdir c:\build-cache |
| 14 | + } |
| 15 | + $bname = 'php-sdk-' + $env:BIN_SDK_VER + '.zip' |
| 16 | + if (-not (Test-Path c:\build-cache\$bname)) { |
| 17 | + (new-object net.webclient).DownloadFile('https://github.com/OSTC/php-sdk-binary-tools/archive/' + $bname, 'c:\build-cache\' + $bname) |
| 18 | + } |
| 19 | + $dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER |
| 20 | + $dname1 = 'php-sdk-' + $env:BIN_SDK_VER |
| 21 | + if (-not (Test-Path c:\build-cache\$dname1)) { |
| 22 | + 7z x c:\build-cache\$bname -oc:\build-cache |
| 23 | + move c:\build-cache\$dname0 c:\build-cache\$dname1 |
| 24 | + } |
| 25 | +
|
| 26 | +cache: |
| 27 | + c:\build-cache -> .appveyor.yml |
| 28 | + |
| 29 | +environment: |
| 30 | + BIN_SDK_VER: 2.0.10 |
| 31 | + matrix: |
| 32 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 33 | + ARCH: x64 |
| 34 | + VC: vc14 |
| 35 | + PHP_VER: 7.0.23 |
| 36 | + TS: 0 |
| 37 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 38 | + ARCH: x64 |
| 39 | + VC: vc14 |
| 40 | + PHP_VER: 7.0.23 |
| 41 | + TS: 1 |
| 42 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 43 | + ARCH: x86 |
| 44 | + VC: vc14 |
| 45 | + PHP_VER: 7.0.23 |
| 46 | + TS: 0 |
| 47 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 48 | + ARCH: x86 |
| 49 | + VC: vc14 |
| 50 | + PHP_VER: 7.0.23 |
| 51 | + TS: 1 |
| 52 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 53 | + ARCH: x64 |
| 54 | + VC: vc14 |
| 55 | + PHP_VER: 7.1.9 |
| 56 | + TS: 0 |
| 57 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 58 | + ARCH: x64 |
| 59 | + VC: vc14 |
| 60 | + PHP_VER: 7.1.9 |
| 61 | + TS: 1 |
| 62 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 63 | + ARCH: x86 |
| 64 | + VC: vc14 |
| 65 | + PHP_VER: 7.1.9 |
| 66 | + TS: 0 |
| 67 | + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 |
| 68 | + ARCH: x86 |
| 69 | + VC: vc14 |
| 70 | + PHP_VER: 7.1.9 |
| 71 | + TS: 1 |
| 72 | + |
| 73 | +build_script: |
| 74 | + ps: | |
| 75 | + $ts_part = '' |
| 76 | + if ('0' -eq $env:TS) { $ts_part = '-nts' } |
| 77 | + $bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip' |
| 78 | + if (-not (Test-Path c:\build-cache\$bname)) { |
| 79 | + (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/archives/' + $bname, 'c:\build-cache\' + $bname) |
| 80 | + if (-not (Test-Path c:\build-cache\$bname)) { |
| 81 | + (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/' + $bname, 'c:\build-cache\' + $bname) |
| 82 | + } |
| 83 | + } |
| 84 | + $dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH |
| 85 | + $dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH |
| 86 | + if (-not (Test-Path c:\build-cache\$dname1)) { |
| 87 | + 7z x c:\build-cache\$bname -oc:\build-cache |
| 88 | + move c:\build-cache\$dname0 c:\build-cache\$dname1 |
| 89 | + } |
| 90 | + cd c:\projects\ast |
| 91 | + $env:PATH = 'c:\build-cache\' + $dname1 + ';' + $env:PATH |
| 92 | + #echo "@echo off" | Out-File -Encoding "ASCII" task.bat |
| 93 | + #echo "" | Out-File -Encoding "ASCII" -Append task.bat |
| 94 | + echo "" | Out-File -Encoding "ASCII" task.bat |
| 95 | + echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat |
| 96 | + echo "call configure --enable-ast --enable-debug-pack 2>&1" | Out-File -Encoding "ASCII" -Append task.bat |
| 97 | + echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat |
| 98 | + $here = (Get-Item -Path ".\" -Verbose).FullName |
| 99 | + $runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat' |
| 100 | + $task = $here + '\task.bat' |
| 101 | + & $runner -t $task |
| 102 | +
|
| 103 | +after_build: |
| 104 | + ps: | |
| 105 | + $ts_part = 'ts' |
| 106 | + if ('0' -eq $env:TS) { $ts_part = 'nts' } |
| 107 | + $zip_bname = 'php_ast-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $ts_part + '-' + $env:VC + '-' + $env:ARCH + '.zip' |
| 108 | + $dir = 'c:\projects\ast\'; |
| 109 | + if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' } |
| 110 | + $dir = $dir + 'Release' |
| 111 | + if ('1' -eq $env:TS) { $dir = $dir + '_TS' } |
| 112 | + & 7z a c:\$zip_bname $dir\php_ast.dll $dir\php_ast.pdb c:\projects\ast\LICENSE |
| 113 | + Push-AppveyorArtifact c:\$zip_bname |
| 114 | +
|
| 115 | +test_script: |
| 116 | + ps: | |
| 117 | + $ts_part = '' |
| 118 | + if ('0' -eq $env:TS) { $ts_part = '-nts' } |
| 119 | + $bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip' |
| 120 | + if (-not (Test-Path c:\build-cache\$bname)) { |
| 121 | + (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/archives/' + $bname, 'c:\build-cache\' + $bname) |
| 122 | + if (-not (Test-Path c:\build-cache\$bname)) { |
| 123 | + (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/' + $bname, 'c:\build-cache\' + $bname) |
| 124 | + } |
| 125 | + } |
| 126 | + $dname = 'php-' + $env:PHP_VER + $ts_part + '-' + $env:VC.toUpper() + '-' + $env:ARCH |
| 127 | + if (-not (Test-Path c:\build-cache\$dname)) { |
| 128 | + 7z x c:\build-cache\$bname -oc:\build-cache\$dname |
| 129 | + } |
| 130 | + cd c:\projects\ast |
| 131 | + echo "" | Out-File -Encoding "ASCII" task.bat |
| 132 | + $cmd = 'call configure --enable-ast --with-prefix=c:\build-cache\' + $dname + " 2>&1" |
| 133 | + echo $cmd | Out-File -Encoding "ASCII" -Append task.bat |
| 134 | + echo "nmake /nologo test TESTS=-q 2>&1" | Out-File -Encoding "ASCII" -Append task.bat |
| 135 | + $here = (Get-Item -Path ".\" -Verbose).FullName |
| 136 | + $runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat' |
| 137 | + $task = $here + '\task.bat' |
| 138 | + & $runner -t $task |
| 139 | +
|
0 commit comments