appveyor.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. build_cloud: electron-16
  2. image: electron-16-vs2017-15.4.5
  3. build_script:
  4. - ps: >-
  5. echo "Build worker image $env:APPVEYOR_BUILD_WORKER_IMAGE"
  6. &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
  7. if($env:SKIP_GYP_BUILD -eq "true") {
  8. Write-warning "Skipping debug build for older branch"; Exit-AppveyorBuild
  9. } elseif(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
  10. Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
  11. } else {
  12. Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64"
  13. $env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path"
  14. if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') {
  15. $env:RUN_RELEASE_BUILD = "1"
  16. }
  17. $Message = (git log --format=%B -n 1 HEAD) | Out-String
  18. if ((Test-Path Env:\RUN_RELEASE_BUILD)) {
  19. $env:ELECTRON_RELEASE = '1'
  20. Write-Output "release build triggered from api"
  21. }
  22. if ((Test-Path Env:\ELECTRON_RELEASE)) {
  23. Write-Output "Running release build"
  24. python script\bootstrap.py --target_arch=$env:TARGET_ARCH
  25. python script\build.py -c R
  26. python script\create-dist.py
  27. } else {
  28. Write-Output "Running debug build"
  29. python script\bootstrap.py --target_arch=$env:TARGET_ARCH --dev
  30. python script\build.py -c D
  31. }
  32. if ($? -ne 'True') {
  33. throw "Build failed with exit code $?"
  34. } else {
  35. "Build succeeded."
  36. }
  37. Push-AppveyorArtifact out
  38. }
  39. test_script:
  40. - ps: >-
  41. if (Test-Path Env:\ELECTRON_RELEASE) {
  42. Write-Output "Skipping tests for release build"
  43. } else {
  44. $env:RUN_TESTS="true"
  45. Remove-Item Env:\ELECTRON_ENABLE_LOGGING
  46. Remove-Item Env:\ELECTRON_ENABLE_STACK_DUMPING
  47. Write-Output "Running tests for debug build"
  48. }
  49. - if "%RUN_TESTS%"=="true" ( echo Running test suite & python script\test.py --ci --rebuild_native_modules)
  50. - if "%RUN_TESTS%"=="true" ( echo Running verify ffmpeg & python script\verify-ffmpeg.py)
  51. artifacts:
  52. - path: test-results.xml
  53. name: test-results.xml
  54. deploy_script:
  55. - ps: >-
  56. if (Test-Path Env:\ELECTRON_RELEASE) {
  57. if (Test-Path Env:\RUN_RELEASE_BUILD) {
  58. Write-Output "Uploading Electron release distribution to s3"
  59. & python script\upload.py --upload_to_s3
  60. } else {
  61. Write-Output "Uploading Electron release distribution to github releases"
  62. & python script\upload.py
  63. }
  64. }