.appveyor.yml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. version: "{branch}.build.{build}"
  2. skip_tags: true
  3. branches:
  4. only:
  5. - master
  6. - dev
  7. clone_folder: c:\projects\xlswriter
  8. install:
  9. ps: |
  10. if (-not (Test-Path c:\build-cache)) {
  11. mkdir c:\build-cache
  12. }
  13. $bname = 'php-sdk-' + $env:BIN_SDK_VER + '.zip'
  14. if (-not (Test-Path c:\build-cache\$bname)) {
  15. Invoke-WebRequest "https://github.com/OSTC/php-sdk-binary-tools/archive/$bname" -OutFile "c:\build-cache\$bname"
  16. }
  17. $dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
  18. $dname1 = 'php-sdk-' + $env:BIN_SDK_VER
  19. if (-not (Test-Path c:\build-cache\$dname1)) {
  20. 7z x c:\build-cache\$bname -oc:\build-cache
  21. move c:\build-cache\$dname0 c:\build-cache\$dname1
  22. }
  23. $lname0 = 'libxlsxwriter-' + $env:LIBXLSXWRITER_VER + '-' + $env:VC + '-' + $env:ARCH + '.zip'
  24. $lname1 = 'libxlsxwriter'
  25. if (-not (Test-Path c:\build-cache\$lname0)) {
  26. # vc14 is fine also for vc15 builds with PHP
  27. $url = "https://windows.php.net/downloads/pecl/deps/" + $lname0
  28. Invoke-WebRequest $url -OutFile "c:\build-cache\$lname0"
  29. }
  30. if (-not (Test-Path c:\build-cache\$lname1)) {
  31. & 7z x c:\build-cache\$lname0 -oc:\build-cache\$lname1
  32. }
  33. $lname2 = 'zlib-1.2.11.tar.gz'
  34. $lname3 = 'zlib'
  35. if (-not (Test-Path c:\build-cache\$lname2)) {
  36. $zliurl = "http://zlib.net/" + $lname2
  37. Invoke-WebRequest $zliurl -OutFile "c:\build-cache\$lname2"
  38. }
  39. if (-not (Test-Path c:\build-cache\$lname3)) {
  40. & 7z x c:\build-cache\$lname2 -oc:\build-cache
  41. & 7z x c:\build-cache\zlib-1.2.11.tar -oc:\build-cache\$lname3
  42. }
  43. if (-not (Test-Path c:\build-cache\$lname3\Release)) {
  44. cd c:\build-cache\$lname3\zlib-1.2.11
  45. $cmakegen = 'Visual Studio 15 2017'
  46. if ($env:VC -Match "vc14") {
  47. $cmakegen = "Visual Studio 14 2015"
  48. }
  49. & cmake -G $cmakegen -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="/MT"
  50. & cmake --build . --config "Release"
  51. }
  52. cache:
  53. c:\build-cache -> .appveyor.yml
  54. environment:
  55. BIN_SDK_VER: 2.1.2
  56. LIBXLSXWRITER_VER: 0.7.7
  57. matrix:
  58. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  59. ARCH: x64
  60. VC: vc14
  61. PHP_VER: 7.0.28
  62. TS: 0
  63. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  64. ARCH: x64
  65. VC: vc14
  66. PHP_VER: 7.0.28
  67. TS: 1
  68. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  69. ARCH: x86
  70. VC: vc14
  71. PHP_VER: 7.0.28
  72. TS: 0
  73. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  74. ARCH: x86
  75. VC: vc14
  76. PHP_VER: 7.0.28
  77. TS: 1
  78. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  79. ARCH: x64
  80. VC: vc14
  81. PHP_VER: 7.1.15
  82. TS: 0
  83. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  84. ARCH: x64
  85. VC: vc14
  86. PHP_VER: 7.1.15
  87. TS: 1
  88. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  89. ARCH: x86
  90. VC: vc14
  91. PHP_VER: 7.1.15
  92. TS: 0
  93. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  94. ARCH: x86
  95. VC: vc14
  96. PHP_VER: 7.1.15
  97. TS: 1
  98. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  99. ARCH: x64
  100. VC: vc15
  101. PHP_VER: 7.2.3
  102. TS: 0
  103. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  104. ARCH: x64
  105. VC: vc15
  106. PHP_VER: 7.2.3
  107. TS: 1
  108. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  109. ARCH: x86
  110. VC: vc15
  111. PHP_VER: 7.2.3
  112. TS: 0
  113. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  114. ARCH: x86
  115. VC: vc15
  116. PHP_VER: 7.2.3
  117. TS: 1
  118. build_script:
  119. ps: |
  120. $ts_part = ''
  121. if ('0' -eq $env:TS) { $ts_part = '-nts' }
  122. $bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
  123. if (-not (Test-Path c:\build-cache\$bname)) {
  124. Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
  125. if (-not (Test-Path c:\build-cache\$bname)) {
  126. Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
  127. }
  128. }
  129. $dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
  130. $dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
  131. if (-not (Test-Path c:\build-cache\$dname1)) {
  132. 7z x c:\build-cache\$bname -oc:\build-cache
  133. move c:\build-cache\$dname0 c:\build-cache\$dname1
  134. }
  135. cd c:\projects\xlswriter
  136. $env:PATH = 'c:\build-cache\' + $dname1 + ';' + $env:PATH
  137. #echo "@echo off" | Out-File -Encoding "ASCII" task.bat
  138. #echo "" | Out-File -Encoding "ASCII" -Append task.bat
  139. echo "" | Out-File -Encoding "ASCII" task.bat
  140. echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
  141. $conf_cmd = 'call configure --with-xlswriter --with-extra-libs=c:\build-cache\zlib\zlib-1.2.11\Release --with-extra-includes=c:\build-cache\zlib\zlib-1.2.11 --enable-debug-pack 2>&1'
  142. echo $conf_cmd | Out-File -Encoding "ASCII" -Append task.bat
  143. echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
  144. echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
  145. $here = (Get-Item -Path "." -Verbose).FullName
  146. $runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
  147. $task = $here + '\task.bat'
  148. & $runner -t $task
  149. after_build:
  150. ps: |
  151. $ts_part = 'ts'
  152. if ('0' -eq $env:TS) { $ts_part = 'nts' }
  153. $zip_bname = 'php_xlswriter-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $ts_part + '-' + $env:VC + '-' + $env:ARCH + '.zip'
  154. $dir = 'c:\projects\xlswriter\';
  155. if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
  156. $dir = $dir + 'Release'
  157. if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
  158. & 7z a c:\$zip_bname $dir\php_xlswriter.dll c:\projects\xlswriter\LICENSE
  159. Push-AppveyorArtifact c:\$zip_bname
  160. test_script:
  161. ps: |
  162. $ts_part = ''
  163. if ('0' -eq $env:TS) { $ts_part = '-nts' }
  164. $bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
  165. if (-not (Test-Path c:\build-cache\$bname)) {
  166. Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
  167. if (-not (Test-Path c:\build-cache\$bname)) {
  168. Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
  169. }
  170. }
  171. $dname = 'php-' + $env:PHP_VER + $ts_part + '-' + $env:VC.toUpper() + '-' + $env:ARCH
  172. if (-not (Test-Path c:\build-cache\$dname)) {
  173. 7z x c:\build-cache\$bname -oc:\build-cache\$dname
  174. }
  175. cd c:\projects\xlswriter
  176. echo "" | Out-File -Encoding "ASCII" task.bat
  177. echo "set REPORT_EXIT_STATUS=1" | Out-File -Encoding "ASCII" -Append task.bat
  178. $cmd = 'call configure --with-xlswriter --with-xlswriter --with-extra-libs=c:\build-cache\zlib\zlib-1.2.11\Release --with-extra-includes=c:\build-cache\zlib\zlib-1.2.11 --with-prefix=c:\build-cache\' + $dname + ' 2>&1'
  179. echo $cmd | Out-File -Encoding "ASCII" -Append task.bat
  180. echo 'nmake /nologo test TESTS="-q --show-diff --set-timeout 120" 2>&1' | Out-File -Encoding "ASCII" -Append task.bat
  181. echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
  182. $here = (Get-Item -Path "." -Verbose).FullName
  183. $runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
  184. $task = $here + '\task.bat'
  185. & $runner -t $task