appveyor.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. Write-Output "Running tests for debug build"
  45. python script\test.py --ci --rebuild_native_modules
  46. if ($LASTEXITCODE -ne '0') {
  47. throw "Tests failed with exit code $LASTEXITCODE"
  48. } else {
  49. Write-Output "Tests succeeded."
  50. }
  51. python script\verify-ffmpeg.py
  52. if ($LASTEXITCODE -ne '0') {
  53. throw "Verify ffmpeg failed with exit code $LASTEXITCODE"
  54. } else {
  55. "Verify ffmpeg succeeded."
  56. }
  57. }
  58. artifacts:
  59. - path: test-results.xml
  60. name: test-results.xml
  61. deploy_script:
  62. - ps: >-
  63. if (Test-Path Env:\ELECTRON_RELEASE) {
  64. if (Test-Path Env:\RUN_RELEASE_BUILD) {
  65. Write-Output "Uploading Electron release distribution to s3"
  66. & python script\upload.py --upload_to_s3
  67. } else {
  68. Write-Output "Uploading Electron release distribution to github releases"
  69. & python script\upload.py
  70. }
  71. }