vsts.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. resources:
  2. - repo: self
  3. steps:
  4. - bash: |
  5. if [ "$ELECTRON_RELEASE" == "1" ]; then
  6. echo 'Bootstrapping Electron for release build'
  7. script/bootstrap.py --target_arch=$TARGET_ARCH
  8. else
  9. echo 'Bootstrapping Electron for debug build'
  10. script/bootstrap.py --target_arch=$TARGET_ARCH --dev
  11. fi
  12. name: Bootstrap
  13. - bash: |
  14. npm run lint
  15. name: Lint
  16. condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
  17. - bash: |
  18. if [ "$ELECTRON_RELEASE" == "1" ]; then
  19. echo 'Building Electron for release'
  20. script/build.py -c R
  21. else
  22. echo 'Building Electron for debug'
  23. script/build.py -c D
  24. fi
  25. name: Build
  26. - bash: |
  27. echo 'Creating Electron release distribution'
  28. script/create-dist.py
  29. name: Create_distribution
  30. condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
  31. - bash: |
  32. if [ "$UPLOAD_TO_S3" != "1" ]; then
  33. echo 'Uploading Electron release distribution to github releases'
  34. ELECTRON_S3_BUCKET="$(s3_bucket)" ELECTRON_S3_ACCESS_KEY="$(s3_access_key)" ELECTRON_S3_SECRET_KEY="$(s3_secret_key)" ELECTRON_GITHUB_TOKEN="$(github_token)" script/upload.py
  35. else
  36. echo 'Uploading Electron release distribution to s3'
  37. ELECTRON_S3_BUCKET="$(s3_bucket)" ELECTRON_S3_ACCESS_KEY="$(s3_access_key)" ELECTRON_S3_SECRET_KEY="$(s3_secret_key)" ELECTRON_GITHUB_TOKEN="$(github_token)" script/upload.py --upload_to_s3
  38. fi
  39. name: Upload_distribution
  40. condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
  41. - bash: |
  42. echo 'Testing Electron build'
  43. mkdir junit
  44. export MOCHA_FILE="junit/test-results.xml"
  45. export MOCHA_REPORTER="mocha-junit-reporter"
  46. if [ "$ELECTRON_RELEASE" == "1" ]; then
  47. script/test.py --ci --rebuild_native_modules -c R
  48. else
  49. script/test.py --ci --rebuild_native_modules
  50. fi
  51. name: Test
  52. - bash: |
  53. echo 'Verifying ffmpeg on build'
  54. if [ "$ELECTRON_RELEASE" == "1" ]; then
  55. script/verify-ffmpeg.py -R
  56. else
  57. script/verify-ffmpeg.py
  58. fi
  59. name: Verify_FFmpeg
  60. - task: PublishTestResults@2
  61. displayName: Publish Test Results
  62. inputs:
  63. testResultsFiles: 'test-results.xml'
  64. searchFolder: junit
  65. condition: and(always(), ne(variables['ELECTRON_RELEASE'], '1'))
  66. - task: kasunkodagoda.slack-notification.slack-notification-task.SlackNotification@3
  67. displayName: Post Slack Notification
  68. inputs:
  69. SlackApiToken: '$(slack_token)'
  70. Channel: '#bot-nightly-releases'
  71. Message: '$(Build.DefinitionName)-$(Build.BuildNumber) finished with a $(Agent.JobStatus) status.'
  72. condition: and(always(), eq(variables['Build.Reason'], 'Schedule'))
  73. - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3