forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsts.yml
97 lines (86 loc) · 3.65 KB
/
vsts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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: |
if [ "$UPLOAD_TO_S3" != "1" ]; then
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: |
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-*.xml'
condition: and(always(), eq(variables['MOCHA_FILE'], 'test-results.xml'))
- 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
displayName: Publish Build Artifacts
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/out'
ArtifactName: out
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3