Merge pull request #14652 from electron/no-slack-notify-on-release
ci: Skip VSTS builds on older branches
This commit is contained in:
commit
d417759885
1 changed files with 12 additions and 65 deletions
77
vsts.yml
77
vsts.yml
|
@ -2,29 +2,21 @@ resources:
|
||||||
- repo: self
|
- repo: self
|
||||||
steps:
|
steps:
|
||||||
- bash: |
|
- bash: |
|
||||||
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
echo 'Non release VSTS builds do not run on older branches'
|
||||||
echo 'Bootstrapping Electron for release build'
|
displayName: Skip build on older branch
|
||||||
script/bootstrap.py --target_arch=$TARGET_ARCH
|
condition: ne(variables['ELECTRON_RELEASE'], '1')
|
||||||
else
|
|
||||||
echo 'Bootstrapping Electron for debug build'
|
- bash: |
|
||||||
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
|
echo 'Bootstrapping Electron for release build'
|
||||||
fi
|
script/bootstrap.py --target_arch=$TARGET_ARCH
|
||||||
name: Bootstrap
|
name: Bootstrap
|
||||||
|
condition: eq(variables['ELECTRON_RELEASE'], '1')
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
npm run lint
|
echo 'Building Electron for release'
|
||||||
name: Lint
|
script/build.py -c R
|
||||||
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
|
name: Build
|
||||||
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
echo 'Creating Electron release distribution'
|
echo 'Creating Electron release distribution'
|
||||||
|
@ -43,56 +35,11 @@ steps:
|
||||||
name: Upload_distribution
|
name: Upload_distribution
|
||||||
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
||||||
|
|
||||||
- bash: |
|
|
||||||
echo 'Testing Electron build'
|
|
||||||
mkdir junit
|
|
||||||
export MOCHA_FILE="junit/test-results.xml"
|
|
||||||
export MOCHA_REPORTER="mocha-junit-reporter"
|
|
||||||
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
||||||
script/test.py --ci --rebuild_native_modules -c R
|
|
||||||
else
|
|
||||||
script/test.py --ci --rebuild_native_modules
|
|
||||||
fi
|
|
||||||
name: Test
|
|
||||||
condition: or(ne(variables['ELECTRON_RELEASE'], '1'), eq(variables['UPLOAD_TO_S3'], '1'))
|
|
||||||
|
|
||||||
- bash: |
|
|
||||||
echo 'Verifying ffmpeg on build'
|
|
||||||
if [ "$ELECTRON_RELEASE" == "1" ]; then
|
|
||||||
script/verify-ffmpeg.py -R
|
|
||||||
else
|
|
||||||
script/verify-ffmpeg.py
|
|
||||||
fi
|
|
||||||
name: Verify_FFmpeg
|
|
||||||
condition: or(ne(variables['ELECTRON_RELEASE'], '1'), eq(variables['UPLOAD_TO_S3'], '1'))
|
|
||||||
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: Publish Test Results
|
|
||||||
inputs:
|
|
||||||
testResultsFiles: 'test-results.xml'
|
|
||||||
searchFolder: junit
|
|
||||||
condition: and(always(), ne(variables['ELECTRON_RELEASE'], '1'))
|
|
||||||
|
|
||||||
- bash: |
|
|
||||||
export BUILD_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}"
|
|
||||||
export MESSAGE="Build failed for *<$BUILD_URL|$BUILD_DEFINITIONNAME>* nightly build."
|
|
||||||
curl -g -H "Content-Type: application/json" -X POST \
|
|
||||||
-d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$BUILD_DEFINITIONNAME nightly build results\",\"title_link\": \"$BUILD_URL\"}]}" $(slack_webhook)
|
|
||||||
name: Post_Slack_Notification_on_Failure
|
|
||||||
condition: failed()
|
|
||||||
|
|
||||||
- bash: |
|
|
||||||
export BUILD_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}"
|
|
||||||
export MESSAGE="Build succeeded for *<$BUILD_URL|$BUILD_DEFINITIONNAME>* nightly build."
|
|
||||||
curl -g -H "Content-Type: application/json" -X POST \
|
|
||||||
-d "{\"text\": \"$MESSAGE\", \"attachments\": [{\"color\": \"#FC5C3C\",\"title\": \"$BUILD_DEFINITIONNAME nightly build results\",\"title_link\": \"$BUILD_URL\"}]}" $(slack_webhook)
|
|
||||||
name: Post_Slack_Notification_on_Success
|
|
||||||
condition: succeeded()
|
|
||||||
|
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
displayName: Publish Build Artifacts
|
displayName: Publish Build Artifacts
|
||||||
inputs:
|
inputs:
|
||||||
PathtoPublish: '$(Build.SourcesDirectory)/out'
|
PathtoPublish: '$(Build.SourcesDirectory)/out'
|
||||||
ArtifactName: out
|
ArtifactName: out
|
||||||
|
condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
|
||||||
|
|
||||||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||||
|
|
Loading…
Reference in a new issue