.appveyor.yml 9.8 KB

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