appveyor.yml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # The config expects the following environment variables to be set:
  2. # - "GN_CONFIG" Build type. One of {'debug', 'testing', 'release'}.
  3. # - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
  4. # e.g. 'target_cpu="x86"' to build for a 32bit platform.
  5. # https://gn.googlesource.com/gn/+/master/docs/reference.md#target_cpu
  6. # Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordningly
  7. # if you pass a custom value for 'target_cpu'.
  8. # - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
  9. # - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
  10. # Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "TARGET_ARCH" value.
  11. # - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
  12. # Is used in some publishing scripts, but does NOT affect the Electron binary.
  13. # Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
  14. # - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket.
  15. # Otherwise the release will be uploaded to the Github Releases.
  16. # (The value is only checked if "ELECTRON_RELEASE" is defined.)
  17. #
  18. # The publishing scripts expect access tokens to be defined as env vars,
  19. # but those are not covered here.
  20. #
  21. # AppVeyor docs on variables:
  22. # https://www.appveyor.com/docs/environment-variables/
  23. # https://www.appveyor.com/docs/build-configuration/#secure-variables
  24. # https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
  25. # Uncomment these lines to enable RDP
  26. #on_finish:
  27. # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
  28. version: 1.0.{build}
  29. build_cloud: libcc-20
  30. image: vs2017-15.9-10.0.18362
  31. environment:
  32. GIT_CACHE_PATH: C:\Users\electron\libcc_cache
  33. ELECTRON_OUT_DIR: Default
  34. ELECTRON_ENABLE_STACK_DUMPING: 1
  35. MOCHA_REPORTER: mocha-multi-reporters
  36. MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
  37. notifications:
  38. - provider: Webhook
  39. url: https://electron-mission-control.herokuapp.com/rest/appveyor-hook
  40. method: POST
  41. headers:
  42. x-mission-control-secret:
  43. secure: 90BLVPcqhJPG7d24v0q/RRray6W3wDQ8uVQlQjOHaBWkw1i8FoA1lsjr2C/v1dVok+tS2Pi6KxDctPUkwIb4T27u4RhvmcPzQhVpfwVJAG9oNtq+yKN7vzHfg7k/pojEzVdJpQLzeJGcSrZu7VY39Q==
  44. on_build_success: false
  45. on_build_failure: true
  46. on_build_status_changed: false
  47. build_script:
  48. - ps: >-
  49. if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
  50. Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
  51. }
  52. - echo "Building $env:GN_CONFIG build"
  53. - git config --global core.longpaths true
  54. - cd ..
  55. - mkdir src
  56. - ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
  57. - ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
  58. - ps: $env:SCCACHE_PATH="$pwd\src\electron\external_binaries\sccache.exe"
  59. - ps: >-
  60. if ($env:GN_CONFIG -eq 'release') {
  61. $env:GCLIENT_EXTRA_ARGS="$env:GCLIENT_EXTRA_ARGS --custom-var=checkout_boto=True --custom-var=checkout_requests=True"
  62. } else {
  63. $env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
  64. }
  65. - >-
  66. gclient config
  67. --name "src\electron"
  68. --unmanaged
  69. %GCLIENT_EXTRA_ARGS%
  70. "https://github.com/electron/electron"
  71. - gclient sync --with_branch_heads --with_tags --reset
  72. - cd src
  73. - ps: $env:BUILD_CONFIG_PATH="//electron/build/args/%GN_CONFIG%.gn"
  74. - gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") %GN_EXTRA_ARGS%"
  75. - gn check out/Default //electron:electron_lib
  76. - gn check out/Default //electron:electron_app
  77. - gn check out/Default //electron:manifests
  78. - gn check out/Default //electron/shell/common/api:mojo
  79. - ninja -C out/Default electron:electron_app
  80. - if "%GN_CONFIG%"=="testing" ( python C:\Users\electron\depot_tools\post_build_ninja_summary.py -C out\Default )
  81. - gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
  82. - ninja -C out/ffmpeg electron:electron_ffmpeg_zip
  83. - ninja -C out/Default electron:electron_dist_zip
  84. - ninja -C out/Default electron:electron_mksnapshot_zip
  85. - ninja -C out/Default electron:electron_chromedriver_zip
  86. - ninja -C out/Default third_party/electron_node:headers
  87. - appveyor PushArtifact out/Default/dist.zip
  88. - appveyor PushArtifact out/Default/chromedriver.zip
  89. - appveyor PushArtifact out/ffmpeg/ffmpeg.zip
  90. - 7z a node_headers.zip out\Default\gen\node_headers
  91. - appveyor PushArtifact node_headers.zip
  92. - appveyor PushArtifact out/Default/mksnapshot.zip
  93. - appveyor PushArtifact out/Default/electron.lib
  94. - ps: >-
  95. if ($env:GN_CONFIG -eq 'release') {
  96. # Needed for msdia140.dll on 64-bit windows
  97. $env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
  98. ninja -C out/Default electron:electron_symbols
  99. }
  100. - ps: >-
  101. if ($env:GN_CONFIG -eq 'release') {
  102. python electron\script\zip-symbols.py
  103. appveyor PushArtifact out/Default/symbols.zip
  104. }
  105. - python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
  106. test_script:
  107. # Workaround for https://github.com/appveyor/ci/issues/2420
  108. - set "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core"
  109. - ps: >-
  110. if ((-Not (Test-Path Env:\TEST_WOA)) -And (-Not (Test-Path Env:\ELECTRON_RELEASE)) -And ($env:GN_CONFIG -in "testing", "release")) {
  111. $env:RUN_TESTS="true"
  112. }
  113. - ps: >-
  114. if ($env:RUN_TESTS -eq 'true') {
  115. New-Item .\out\Default\gen\node_headers\Release -Type directory
  116. Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
  117. } else {
  118. echo "Skipping tests for $env:GN_CONFIG build"
  119. }
  120. - cd electron
  121. - if "%RUN_TESTS%"=="true" ( echo Running test suite & node script/yarn test -- --ci --enable-logging)
  122. - cd ..
  123. - if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
  124. - echo "About to verify mksnapshot"
  125. - if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
  126. - echo "Done verifying mksnapshot"
  127. deploy_script:
  128. - cd electron
  129. - ps: >-
  130. if (Test-Path Env:\ELECTRON_RELEASE) {
  131. if (Test-Path Env:\UPLOAD_TO_S3) {
  132. Write-Output "Uploading Electron release distribution to s3"
  133. & python script\release\uploaders\upload.py --upload_to_s3
  134. } else {
  135. Write-Output "Uploading Electron release distribution to github releases"
  136. & python script\release\uploaders\upload.py
  137. }
  138. } elseif (Test-Path Env:\TEST_WOA) {
  139. node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
  140. }