|
| 1 | +steps: |
| 2 | +- pwsh: | |
| 3 | + Get-ChildItem -Path env: |
| 4 | + displayName: Capture environment |
| 5 | + condition: succeededOrFailed() |
| 6 | + |
| 7 | +- task: PkgESSetupBuild@10 |
| 8 | + displayName: 'Package ES - Setup Build' |
| 9 | + inputs: |
| 10 | + productName: PowerShellEditorServices |
| 11 | + |
| 12 | +- task: DownloadBuildArtifacts@0 |
| 13 | + displayName: 'Download Build Artifacts' |
| 14 | + inputs: |
| 15 | + downloadType: specific |
| 16 | + |
| 17 | +- task: PowerShell@1 |
| 18 | + displayName: 'Extract build zip' |
| 19 | + inputs: |
| 20 | + scriptType: inlineScript |
| 21 | + inlineScript: | |
| 22 | + $dest = New-Item -ItemType Directory $env:BUILD_ARTIFACTSTAGINGDIRECTORY/release/out/PowerShellEditorServices |
| 23 | + $psesZip = Get-ChildItem $env:BUILD_ARTIFACTSTAGINGDIRECTORY/PowerShellEditorServices-CI/PowerShellEditorServices*.zip -ErrorAction Stop |
| 24 | + $psesZip | Expand-Archive -DestinationPath $dest -Force -Verbose |
| 25 | + $psesZip | Remove-Item -Recurse -Force |
| 26 | +
|
| 27 | +- task: PkgESCodeSign@10 |
| 28 | + displayName: 'CodeSign tools/releaseBuild/signing.xml' |
| 29 | + env: |
| 30 | + SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
| 31 | + inputs: |
| 32 | + signConfigXml: tools/releaseBuild/signing.xml |
| 33 | + inPathRoot: '$(Build.ArtifactStagingDirectory)' |
| 34 | + outPathRoot: '$(Build.ArtifactStagingDirectory)\Signed' |
| 35 | + |
| 36 | +- task: PowerShell@1 |
| 37 | + displayName: 'Copy signed items into output' |
| 38 | + inputs: |
| 39 | + scriptType: inlineScript |
| 40 | + inlineScript: | |
| 41 | + $signed="$(Build.ArtifactStagingDirectory)\Signed\PowerShellEditorServices\*" |
| 42 | + $notSigned="$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices" |
| 43 | + Copy-Item $signed $notSigned -Recurse -Force |
| 44 | +
|
| 45 | +- task: PowerShell@1 |
| 46 | + displayName: 'Create catalog files' |
| 47 | + inputs: |
| 48 | + scriptType: inlineScript |
| 49 | + inlineScript: | |
| 50 | + $dir = "$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices\PowerShellEditorServices" |
| 51 | + New-FileCatalog -CatalogFilePath "$(Build.ArtifactStagingDirectory)\PowerShellEditorServices.cat" -Path $dir |
| 52 | +
|
| 53 | + $dir = "$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices\PowerShellEditorServices.VSCode" |
| 54 | + New-FileCatalog -CatalogFilePath "$(Build.ArtifactStagingDirectory)\PowerShellEditorServices.VSCode.cat" -Path $dir |
| 55 | +
|
| 56 | +- task: PkgESCodeSign@10 |
| 57 | + displayName: 'CodeSign tools/releaseBuild/FileCatalogSigning.xml' |
| 58 | + env: |
| 59 | + SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
| 60 | + inputs: |
| 61 | + signConfigXml: tools/releaseBuild/FileCatalogSigning.xml |
| 62 | + inPathRoot: '$(Build.ArtifactStagingDirectory)' |
| 63 | + outPathRoot: '$(Build.ArtifactStagingDirectory)' |
| 64 | + |
| 65 | +- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
| 66 | + displayName: 'Component Detection' |
| 67 | + |
| 68 | +- task: AntiMalware@3 |
| 69 | + inputs: |
| 70 | + InputType: 'Basic' |
| 71 | + ScanType: 'CustomScan' |
| 72 | + FileDirPath: '$(Build.ArtifactStagingDirectory)' |
| 73 | + EnableServices: false |
| 74 | + SupportLogOnError: false |
| 75 | + TreatSignatureUpdateFailureAs: 'Warning' |
| 76 | + SignatureFreshness: 'UpToDate' |
| 77 | + TreatStaleSignatureAs: 'Error' |
| 78 | + |
| 79 | +- task: PoliCheck@1 |
| 80 | + condition: succeededOrFailed() |
| 81 | + inputs: |
| 82 | + targetType: F |
| 83 | + optionsFC: 0 |
| 84 | + optionsXS: 0 |
| 85 | + optionsPE: '1|2|3|4' |
| 86 | + optionsHMENABLE: 0 |
| 87 | + optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml' |
| 88 | + # toolVersion: 5.8.2.1 |
| 89 | + |
| 90 | +- task: CredScan@2 |
| 91 | + condition: succeededOrFailed() |
| 92 | + |
| 93 | +# - task: BinSkim@3 |
| 94 | +# condition: succeededOrFailed() |
| 95 | +# inputs: |
| 96 | +# InputType: 'Basic' |
| 97 | +# Function: 'analyze' |
| 98 | +# AnalyzeRecurse: true |
| 99 | +# AnalyzeTarget: '$(Build.ArtifactStagingDirectory)\release;$(Build.ArtifactStagingDirectory)\OutGridView*.dll' |
| 100 | + |
| 101 | +# Publish results as artifacts |
| 102 | +- task: PublishSecurityAnalysisLogs@3 |
| 103 | + condition: succeededOrFailed() |
| 104 | + inputs: |
| 105 | + ArtifactName: 'CodeAnalysisLogs' |
| 106 | + ArtifactType: 'Container' |
| 107 | + |
| 108 | +# Publish to TSA server |
| 109 | +- task: TSAUpload@1 |
| 110 | + condition: succeededOrFailed() |
| 111 | + continueOnError: true |
| 112 | + inputs: |
| 113 | + tsaVersion: 'TsaV2' |
| 114 | + codebase: 'Existing' |
| 115 | + tsaEnvironment: 'PROD' |
| 116 | + codeBaseName: 'PowerShell_PowerShellEditorServices_20190917' |
| 117 | + uploadAPIScan: false |
| 118 | + uploadBinSkim: false |
| 119 | + uploadCredScan: true |
| 120 | + uploadFortifySCA: false |
| 121 | + uploadFxCop: false |
| 122 | + uploadModernCop: false |
| 123 | + uploadPoliCheck: true |
| 124 | + uploadPREfast: false |
| 125 | + uploadRoslyn: false |
| 126 | + uploadTSLint: false |
| 127 | + uploadAsync: true |
| 128 | + |
| 129 | +- task: PowerShell@1 |
| 130 | + displayName: 'Upload artifacts' |
| 131 | + inputs: |
| 132 | + scriptType: inlineScript |
| 133 | + inlineScript: 'Write-Host "##vso[artifact.upload containerfolder=PowerShellEditorServices;artifactname=PowerShellEditorServices]$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices"' |
0 commit comments