|
| 1 | +steps: |
| 2 | +- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" |
| 3 | + displayName: Set Build Name for Non-PR |
| 4 | + condition: ne(variables['Build.Reason'], 'PullRequest') |
| 5 | + |
| 6 | +- pwsh: | |
| 7 | + Get-ChildItem -Path env: |
| 8 | + displayName: Capture environment |
| 9 | + condition: succeededOrFailed() |
| 10 | + |
| 11 | +- task: PkgESSetupBuild@10 |
| 12 | + displayName: 'Package ES - Setup Build' |
| 13 | + inputs: |
| 14 | + productName: vscode-powershell |
| 15 | + |
| 16 | +- task: PowerShell@2 |
| 17 | + displayName: 'Set environment variables for VSTS (Phase 1)' |
| 18 | + inputs: |
| 19 | + targetType: filePath |
| 20 | + filePath: ./tools/releaseBuild/setVstsVariables.ps1 |
| 21 | + |
| 22 | +- task: PowerShell@2 |
| 23 | + displayName: 'Find PowerShellEditorServices build' |
| 24 | + env: |
| 25 | + SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
| 26 | + inputs: |
| 27 | + targetType: filePath |
| 28 | + filePath: ./tools/releaseBuild/findPsesBuild.ps1 |
| 29 | + |
| 30 | +- task: DownloadBuildArtifacts@0 |
| 31 | + displayName: 'Download Build Artifacts from PowerShell Editor Services' |
| 32 | + inputs: |
| 33 | + buildType: specific |
| 34 | + project: '8e2735c1-3674-408a-bcab-87f089ea29d5' |
| 35 | + pipeline: 1056 |
| 36 | + buildVersionToDownload: specific |
| 37 | + buildId: '$(PSES_BUILDID)' |
| 38 | + downloadType: specific |
| 39 | + downloadPath: '$(Build.SourcesDirectory)' |
| 40 | + |
| 41 | +- pwsh: | |
| 42 | + Install-Module InvokeBuild -Force |
| 43 | + Invoke-Build Release |
| 44 | +
|
| 45 | +- task: PublishTestResults@2 |
| 46 | + inputs: |
| 47 | + testRunner: JUnit |
| 48 | + testResultsFiles: '**/test-results.xml' |
| 49 | + condition: succeededOrFailed() |
| 50 | + |
| 51 | +- task: PkgESCodeSign@10 |
| 52 | + displayName: 'CodeSign tools/releaseBuild/signing.xml' |
| 53 | + env: |
| 54 | + SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
| 55 | + inputs: |
| 56 | + signConfigXml: tools/releaseBuild/signing.xml |
| 57 | + inPathRoot: '$(Build.ArtifactStagingDirectory)' |
| 58 | + outPathRoot: '$(Build.ArtifactStagingDirectory)\Signed' |
| 59 | + |
| 60 | +- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 61 | + displayName: 'Component Detection' |
| 62 | + |
| 63 | +- task: AntiMalware@3 |
| 64 | + inputs: |
| 65 | + InputType: 'Basic' |
| 66 | + ScanType: 'CustomScan' |
| 67 | + FileDirPath: '$(Build.ArtifactStagingDirectory)' |
| 68 | + EnableServices: false |
| 69 | + SupportLogOnError: false |
| 70 | + TreatSignatureUpdateFailureAs: 'Warning' |
| 71 | + SignatureFreshness: 'UpToDate' |
| 72 | + TreatStaleSignatureAs: 'Error' |
| 73 | + |
| 74 | +- task: PoliCheck@1 |
| 75 | + condition: succeededOrFailed() |
| 76 | + inputs: |
| 77 | + targetType: F |
| 78 | + optionsFC: 0 |
| 79 | + optionsXS: 0 |
| 80 | + optionsPE: '1|2|3|4' |
| 81 | + optionsHMENABLE: 0 |
| 82 | + optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml' |
| 83 | + # toolVersion: 5.8.2.1 |
| 84 | + |
| 85 | +- task: CredScan@2 |
| 86 | + condition: succeededOrFailed() |
| 87 | + |
| 88 | +# Publish results as artifacts |
| 89 | +- task: PublishSecurityAnalysisLogs@3 |
| 90 | + condition: succeededOrFailed() |
| 91 | + inputs: |
| 92 | + ArtifactName: 'CodeAnalysisLogs' |
| 93 | + ArtifactType: 'Container' |
| 94 | + |
| 95 | +# Publish to TSA server |
| 96 | +- task: TSAUpload@1 |
| 97 | + condition: succeededOrFailed() |
| 98 | + continueOnError: true |
| 99 | + inputs: |
| 100 | + tsaVersion: 'TsaV2' |
| 101 | + codebase: 'Existing' |
| 102 | + tsaEnvironment: 'PROD' |
| 103 | + codeBaseName: 'PowerShell_PowerShellEditorServices_20190917' |
| 104 | + uploadAPIScan: false |
| 105 | + uploadBinSkim: false |
| 106 | + uploadCredScan: true |
| 107 | + uploadFortifySCA: false |
| 108 | + uploadFxCop: false |
| 109 | + uploadModernCop: false |
| 110 | + uploadPoliCheck: true |
| 111 | + uploadPREfast: false |
| 112 | + uploadRoslyn: false |
| 113 | + uploadTSLint: false |
| 114 | + uploadAsync: true |
| 115 | + |
| 116 | +- task: PowerShell@1 |
| 117 | + displayName: 'Upload artifacts' |
| 118 | + inputs: |
| 119 | + scriptType: inlineScript |
| 120 | + inlineScript: 'Write-Host "##vso[artifact.upload containerfolder=vscode-powershell;artifactname=vscode-powershell]$(System.ArtifactsDirectory)\Signed"' |
0 commit comments