vsts.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 [ "$TRIGGERED_BY_API" != "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 debug build'
  43. mkdir junit
  44. export MOCHA_FILE="junit/test-results.xml"
  45. export MOCHA_REPORTER="mocha-junit-reporter"
  46. script/test.py --ci
  47. name: Test
  48. condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
  49. - bash: |
  50. echo 'Verifying ffmpeg on debug build'
  51. script/verify-ffmpeg.py
  52. name: Verify_FFmpeg
  53. condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
  54. - task: PublishTestResults@2
  55. displayName: Publish Test Results
  56. inputs:
  57. testResultsFiles: 'test-results.xml'
  58. searchFolder: junit
  59. condition: and(always(), ne(variables['ELECTRON_RELEASE'], '1'))
  60. - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3