Browse Source

ci: Skip VSTS testing builds on older branches

Also, don't send slack notifications for actual releases
John Kleinschmidt 6 years ago
parent
commit
d483d4ee34
1 changed files with 15 additions and 54 deletions
  1. 15 54
      vsts.yml

+ 15 - 54
vsts.yml

@@ -2,29 +2,21 @@ 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
+    echo 'Non release VSTS builds do not run on older branches'
+  displayName: Skip build on older branch
+  condition: ne(variables['ELECTRON_RELEASE'], '1')
 
 - bash: |
-    npm run lint
-  name: Lint
-  condition: and(succeeded(), ne(variables['ELECTRON_RELEASE'], '1'))
+    echo 'Bootstrapping Electron for release build'
+    script/bootstrap.py --target_arch=$TARGET_ARCH
+  name: Bootstrap
+  condition: eq(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
+    echo 'Building Electron for release'
+    script/build.py -c R
   name: Build
+  condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
 
 - bash: |
     echo 'Creating Electron release distribution'
@@ -43,42 +35,11 @@ steps:
   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-results.xml'
-    searchFolder: junit
-  condition: and(always(), ne(variables['ELECTRON_RELEASE'], '1'))
-
-- task: kasunkodagoda.slack-notification.slack-notification-task.SlackNotification@3
-  displayName: Post Slack Notification
+- task: PublishBuildArtifacts@1
+  displayName: Publish Build Artifacts
   inputs:
-    SlackApiToken: '$(slack_token)'
-    Channel: '#bot-nightly-releases'
-    Message: '$(Build.DefinitionName)-$(Build.BuildNumber) finished with a $(Agent.JobStatus) status.'
-  condition: and(always(), eq(variables['Build.Reason'], 'Schedule'))
+    PathtoPublish: '$(Build.SourcesDirectory)/out'
+    ArtifactName: out
+  condition: and(succeeded(), eq(variables['ELECTRON_RELEASE'], '1'))
 
 - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3