appveyor.yml 2.5 KB

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