.appveyor.yml 9.6 KB

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