appveyor.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. build_cloud: electron-16
  2. image: electron-16-vs2015
  3. build_script:
  4. - ps: >-
  5. if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
  6. Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
  7. } else {
  8. Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64"
  9. $env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path"
  10. if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') {
  11. $env:RUN_RELEASE_BUILD = "1"
  12. }
  13. $Message = (git log --format=%B -n 1 HEAD) | Out-String
  14. if ((Test-Path Env:\RUN_RELEASE_BUILD)) {
  15. $env:ELECTRON_RELEASE = '1'
  16. Write-Output "release build triggered from api"
  17. }
  18. if ((Test-Path Env:\ELECTRON_RELEASE)) {
  19. Write-Output "Running release build"
  20. python script\bootstrap.py --target_arch=$env:TARGET_ARCH
  21. python script\build.py -c R
  22. python script\create-dist.py
  23. } else {
  24. Write-Output "Running debug build"
  25. python script\bootstrap.py --target_arch=$env:TARGET_ARCH --dev
  26. python script\build.py -c D
  27. }
  28. if ($? -ne 'True') {
  29. throw "Build failed with exit code $?"
  30. } else {
  31. "Build succeeded."
  32. }
  33. Push-AppveyorArtifact out
  34. }
  35. test_script:
  36. - ps: >-
  37. if (Test-Path Env:\ELECTRON_RELEASE) {
  38. Write-Output "Skipping tests for release build"
  39. } else {
  40. Write-Output "Running tests for debug build"
  41. python script\test.py --ci --rebuild_native_modules
  42. if ($LASTEXITCODE -ne '0') {
  43. throw "Tests failed with exit code $LASTEXITCODE"
  44. } else {
  45. Write-Output "Tests succeeded."
  46. }
  47. python script\verify-ffmpeg.py
  48. if ($LASTEXITCODE -ne '0') {
  49. throw "Verify ffmpeg failed with exit code $LASTEXITCODE"
  50. } else {
  51. "Verify ffmpeg succeeded."
  52. }
  53. }
  54. artifacts:
  55. - path: test-results.xml
  56. name: test-results.xml
  57. deploy_script:
  58. - 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 if (Test-Path Env:\\AUTO_RELEASE) {\n node script\\release.js --validateRelease --automaticRelease\n if ($? -eq 'True') {\n echo 'Release is ready to go; now running release'\n node script\\release.js --automaticRelease\n if ($? -eq 'True') { \n echo 'Release successful, now publishing to npm' \n $npmfile = \"$HOME\\.npmrc\"\n \"//registry.npmjs.org/:_authToken=$env:ELECTRON_NPM_TOKEN\" > $npmfile\n npm run publish-to-npm\n }\n } else {\n echo 'Release is not complete, skipping publish for now.'\n }\n }\n }\n} else {\n Write-Output \"Skipping upload distribution because build is not for release\"\n}"