2018-05-22 17:50:44 +00:00
|
|
|
resources:
|
|
|
|
- repo: self
|
|
|
|
steps:
|
|
|
|
- bash: |
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo 'Bootstrapping Electron for release build'
|
|
|
|
script/bootstrap.py --target_arch=$TARGET_ARCH
|
|
|
|
else
|
|
|
|
echo 'Bootstrapping Electron for debug build'
|
|
|
|
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
|
|
|
|
fi
|
|
|
|
name: Bootstrap
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
npm run lint
|
|
|
|
name: Lint
|
|
|
|
condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
echo 'Building Electron for release'
|
|
|
|
script/build.py -c R
|
|
|
|
else
|
|
|
|
echo 'Building Electron for debug'
|
|
|
|
script/build.py -c D
|
|
|
|
fi
|
|
|
|
name: Build
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
echo 'Creating Electron release distribution'
|
|
|
|
script/create-dist.py
|
|
|
|
name: Create_distribution
|
|
|
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
|
|
|
|
|
|
|
- bash: |
|
2018-06-13 20:11:26 +00:00
|
|
|
if [ "$UPLOAD_TO_S3" != "1" ]; then
|
2018-05-22 17:50:44 +00:00
|
|
|
echo 'Uploading Electron release distribution to github releases'
|
|
|
|
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
|
|
|
|
else
|
|
|
|
echo 'Uploading Electron release distribution to s3'
|
|
|
|
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
|
|
|
|
fi
|
|
|
|
name: Upload_distribution
|
|
|
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
|
|
|
|
|
|
|
- bash: |
|
2018-06-18 20:35:36 +00:00
|
|
|
echo 'Testing Electron build'
|
2018-05-22 17:50:44 +00:00
|
|
|
mkdir junit
|
|
|
|
export MOCHA_FILE="junit/test-results.xml"
|
|
|
|
export MOCHA_REPORTER="mocha-junit-reporter"
|
2018-06-18 20:35:36 +00:00
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
script/test.py --ci --rebuild_native_modules -c R
|
|
|
|
else
|
|
|
|
script/test.py --ci --rebuild_native_modules
|
|
|
|
fi
|
2018-05-22 17:50:44 +00:00
|
|
|
name: Test
|
|
|
|
|
2018-06-13 20:11:26 +00:00
|
|
|
- bash: |
|
2018-06-18 20:35:36 +00:00
|
|
|
echo 'Verifying ffmpeg on build'
|
|
|
|
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
|
|
script/verify-ffmpeg.py -R
|
|
|
|
else
|
|
|
|
script/verify-ffmpeg.py
|
|
|
|
fi
|
2018-06-13 20:11:26 +00:00
|
|
|
name: Verify_FFmpeg
|
|
|
|
|
2018-05-22 17:50:44 +00:00
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
2018-07-05 14:59:47 +00:00
|
|
|
testResultsFiles: '**/test-*.xml'
|
|
|
|
condition: and(always(), eq(variables['MOCHA_FILE'], 'test-results.xml'))
|
2018-05-22 17:50:44 +00:00
|
|
|
|
2018-06-14 15:12:35 +00:00
|
|
|
- task: kasunkodagoda.slack-notification.slack-notification-task.SlackNotification@3
|
2018-07-05 14:59:47 +00:00
|
|
|
displayName: Post Slack Notification on Failure
|
2018-06-14 15:12:35 +00:00
|
|
|
inputs:
|
|
|
|
SlackApiToken: '$(slack_token)'
|
|
|
|
Channel: '#bot-nightly-releases'
|
2018-07-05 14:59:47 +00:00
|
|
|
Message: 'Build failed for *<$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)|$(Build.DefinitionName)>* nightly build.'
|
|
|
|
Title: '$(Build.DefinitionName) nightly build results'
|
|
|
|
TitleLink: '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)'
|
|
|
|
Color: '#FC5C3C'
|
|
|
|
condition: and(failed(), eq(variables['Build.Reason'], 'Schedule'))
|
|
|
|
|
|
|
|
- task: kasunkodagoda.slack-notification.slack-notification-task.SlackNotification@3
|
|
|
|
displayName: Post Slack Notification on Success
|
|
|
|
inputs:
|
|
|
|
SlackApiToken: '$(slack_token)'
|
|
|
|
Channel: '#bot-nightly-releases'
|
|
|
|
Message: 'Build succeeded for *<$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)|$(Build.DefinitionName)>* nightly build.'
|
|
|
|
Title: '$(Build.DefinitionName) nightly build results'
|
|
|
|
TitleLink: '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)'
|
|
|
|
Color: 'good'
|
|
|
|
condition: and(succeeded(), eq(variables['Build.Reason'], 'Schedule'))
|
2018-06-14 15:12:35 +00:00
|
|
|
|
2018-05-22 17:50:44 +00:00
|
|
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|