.appveyor.yml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. version: "{branch}.build.{build}"
  2. branches:
  3. only:
  4. - master
  5. - dev
  6. clone_folder: c:\projects\xlswriter
  7. install:
  8. ps: |
  9. if (-not (Test-Path c:\build-cache)) {
  10. mkdir c:\build-cache
  11. }
  12. $bname = 'php-sdk-' + $env:BIN_SDK_VER + '.zip'
  13. if (-not (Test-Path c:\build-cache\$bname)) {
  14. Invoke-WebRequest "https://github.com/OSTC/php-sdk-binary-tools/archive/$bname" -OutFile "c:\build-cache\$bname"
  15. }
  16. $dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
  17. $dname1 = 'php-sdk-' + $env:BIN_SDK_VER
  18. if (-not (Test-Path c:\build-cache\$dname1)) {
  19. 7z x c:\build-cache\$bname -oc:\build-cache
  20. move c:\build-cache\$dname0 c:\build-cache\$dname1
  21. }
  22. $lname0 = 'zlib-' + $env:ZLIB_VER + '-' + $env:VC.toLower() + '-' + $env:ARCH + '.zip'
  23. $lname1 = 'zlib'
  24. if (-not (Test-Path c:\build-cache\$lname0)) {
  25. $zliurl = "https://windows.php.net/downloads/php-sdk/deps/" + $env:VC.toLower() + "/" + $env:ARCH + "/" + $lname0
  26. Invoke-WebRequest $zliurl -OutFile "c:\build-cache\$lname0"
  27. }
  28. if (-not (Test-Path c:\build-cache\$lname1)) {
  29. 7z x c:\build-cache\$lname0 -oc:\build-cache\$lname1
  30. }
  31. cache:
  32. c:\build-cache -> .appveyor.yml
  33. environment:
  34. BIN_SDK_VER: 2.2.0
  35. matrix:
  36. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  37. ARCH: x64
  38. VC: VC14
  39. PHP_VER: 7.0.28
  40. ZLIB_VER: 1.2.8
  41. TS: 0
  42. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  43. ARCH: x64
  44. VC: VC14
  45. PHP_VER: 7.0.28
  46. ZLIB_VER: 1.2.8
  47. TS: 1
  48. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  49. ARCH: x86
  50. VC: VC14
  51. PHP_VER: 7.0.28
  52. ZLIB_VER: 1.2.8
  53. TS: 0
  54. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  55. ARCH: x86
  56. VC: VC14
  57. PHP_VER: 7.0.28
  58. ZLIB_VER: 1.2.8
  59. TS: 1
  60. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  61. ARCH: x64
  62. VC: VC14
  63. PHP_VER: 7.1.15
  64. ZLIB_VER: 1.2.8
  65. TS: 0
  66. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  67. ARCH: x64
  68. VC: VC14
  69. PHP_VER: 7.1.15
  70. ZLIB_VER: 1.2.8
  71. TS: 1
  72. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  73. ARCH: x86
  74. VC: VC14
  75. PHP_VER: 7.1.15
  76. ZLIB_VER: 1.2.8
  77. TS: 0
  78. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  79. ARCH: x86
  80. VC: VC14
  81. PHP_VER: 7.1.15
  82. ZLIB_VER: 1.2.8
  83. TS: 1
  84. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  85. ARCH: x64
  86. VC: VC15
  87. PHP_VER: 7.2.3
  88. ZLIB_VER: 1.2.11
  89. TS: 0
  90. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  91. ARCH: x64
  92. VC: VC15
  93. PHP_VER: 7.2.3
  94. ZLIB_VER: 1.2.11
  95. TS: 1
  96. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  97. ARCH: x86
  98. VC: VC15
  99. PHP_VER: 7.2.3
  100. ZLIB_VER: 1.2.11
  101. TS: 0
  102. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  103. ARCH: x86
  104. VC: VC15
  105. PHP_VER: 7.2.3
  106. ZLIB_VER: 1.2.11
  107. TS: 1
  108. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  109. ARCH: x64
  110. VC: VC15
  111. PHP_VER: 7.3.0
  112. ZLIB_VER: 1.2.11
  113. TS: 0
  114. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  115. ARCH: x64
  116. VC: VC15
  117. PHP_VER: 7.3.0
  118. ZLIB_VER: 1.2.11
  119. TS: 1
  120. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  121. ARCH: x86
  122. VC: VC15
  123. PHP_VER: 7.3.0
  124. ZLIB_VER: 1.2.11
  125. TS: 0
  126. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  127. ARCH: x86
  128. VC: VC15
  129. PHP_VER: 7.3.0
  130. ZLIB_VER: 1.2.11
  131. TS: 1
  132. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  133. ARCH: x64
  134. VC: VC15
  135. PHP_VER: 7.4.0
  136. ZLIB_VER: 1.2.11
  137. TS: 0
  138. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  139. ARCH: x64
  140. VC: VC15
  141. PHP_VER: 7.4.0
  142. ZLIB_VER: 1.2.11
  143. TS: 1
  144. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  145. ARCH: x86
  146. VC: VC15
  147. PHP_VER: 7.4.0
  148. ZLIB_VER: 1.2.11
  149. TS: 0
  150. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  151. ARCH: x86
  152. VC: VC15
  153. PHP_VER: 7.4.0
  154. ZLIB_VER: 1.2.11
  155. TS: 1
  156. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  157. ARCH: x64
  158. VC: vs16
  159. PHP_VER: 8.0.0
  160. ZLIB_VER: 1.2.11
  161. TS: 0
  162. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  163. ARCH: x64
  164. VC: vs16
  165. PHP_VER: 8.0.0
  166. ZLIB_VER: 1.2.11
  167. TS: 1
  168. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  169. ARCH: x86
  170. VC: vs16
  171. PHP_VER: 8.0.0
  172. ZLIB_VER: 1.2.11
  173. TS: 0
  174. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  175. ARCH: x86
  176. VC: vs16
  177. PHP_VER: 8.0.0
  178. ZLIB_VER: 1.2.11
  179. TS: 1
  180. build_script:
  181. ps: |
  182. $ts_part = ''
  183. if ('0' -eq $env:TS) { $ts_part = '-nts' }
  184. $bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC + '-' + $env:ARCH + '.zip'
  185. if (-not (Test-Path c:\build-cache\$bname)) {
  186. try {
  187. Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
  188. } catch {
  189. if (-not (Test-Path c:\build-cache\$bname)) {
  190. Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
  191. }
  192. }
  193. }
  194. $dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC + '-' + $env:ARCH
  195. $dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC + '-' + $env:ARCH
  196. if (-not (Test-Path c:\build-cache\$dname1)) {
  197. 7z x c:\build-cache\$bname -oc:\build-cache
  198. move c:\build-cache\$dname0 c:\build-cache\$dname1
  199. }
  200. cd c:\projects\xlswriter
  201. $env:PATH = 'c:\build-cache\' + $dname1 + ';' + $env:PATH
  202. #echo "@echo off" | Out-File -Encoding "ASCII" task.bat
  203. #echo "" | Out-File -Encoding "ASCII" -Append task.bat
  204. echo "" | Out-File -Encoding "ASCII" task.bat
  205. echo "call git submodule update --init 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
  206. echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
  207. $conf_cmd = 'call configure --with-xlswriter --with-extra-libs=c:\build-cache\zlib\lib --with-extra-includes=c:\build-cache\zlib\include --enable-debug-pack 2>&1'
  208. echo $conf_cmd | Out-File -Encoding "ASCII" -Append task.bat
  209. echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
  210. echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
  211. $here = (Get-Item -Path "." -Verbose).FullName
  212. $runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
  213. $task = $here + '\task.bat'
  214. & $runner -t $task
  215. after_build:
  216. ps: |
  217. $ts_part = 'ts'
  218. if ('0' -eq $env:TS) { $ts_part = 'nts' }
  219. $zip_bname = 'php-windows-xlswriter-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $ts_part + '-' + $env:VC + '-' + $env:ARCH + '.zip'
  220. $dir = 'c:\projects\xlswriter\';
  221. if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
  222. $dir = $dir + 'Release'
  223. if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
  224. if (-not (Test-Path c:\build-cache\zlib\lib\zlib.pdb)) {
  225. 7z a c:\$zip_bname $dir\php_xlswriter.dll c:\projects\xlswriter\LICENSE c:\build-cache\zlib\lib\zlib_a.lib c:\build-cache\zlib\lib\zlib_a.pdb
  226. } else {
  227. 7z a c:\$zip_bname $dir\php_xlswriter.dll c:\projects\xlswriter\LICENSE c:\build-cache\zlib\lib\zlib_a.lib c:\build-cache\zlib\lib\zlib.pdb
  228. }
  229. Push-AppveyorArtifact c:\$zip_bname
  230. test_script:
  231. ps: |
  232. $ts_part = ''
  233. if ('0' -eq $env:TS) { $ts_part = '-nts' }
  234. $bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC + '-' + $env:ARCH + '.zip'
  235. if (-not (Test-Path c:\build-cache\$bname)) {
  236. try {
  237. Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
  238. } catch {
  239. if (-not (Test-Path c:\build-cache\$bname)) {
  240. Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
  241. }
  242. }
  243. }
  244. $dname = 'php-' + $env:PHP_VER + $ts_part + '-' + $env:VC + '-' + $env:ARCH
  245. if (-not (Test-Path c:\build-cache\$dname)) {
  246. 7z x c:\build-cache\$bname -oc:\build-cache\$dname
  247. }
  248. cd c:\projects\xlswriter
  249. echo "" | Out-File -Encoding "ASCII" task.bat
  250. echo "set REPORT_EXIT_STATUS=1" | Out-File -Encoding "ASCII" -Append task.bat
  251. $cmd = 'call configure --with-xlswriter --with-extra-libs=c:\build-cache\zlib\lib --with-extra-includes=c:\build-cache\zlib\include --with-prefix=c:\build-cache\' + $dname + ' 2>&1'
  252. echo $cmd | Out-File -Encoding "ASCII" -Append task.bat
  253. echo 'nmake /nologo test TESTS="-q --show-diff --set-timeout 120" 2>&1' | Out-File -Encoding "ASCII" -Append task.bat
  254. echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
  255. $here = (Get-Item -Path "." -Verbose).FullName
  256. $runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
  257. $task = $here + '\task.bat'
  258. & $runner -t $task
  259. deploy:
  260. provider: GitHub
  261. auth_token: $(GITHUB_OAUTH_TOKEN)
  262. draft: false
  263. prerelease: false
  264. on:
  265. APPVEYOR_REPO_TAG: true