|
1 | 1 | steps: |
2 | | -- powershell: | |
3 | | - Write-Host "Installing pwsh..." |
4 | | - if (Get-Command pwsh -ErrorAction Ignore) |
5 | | - { |
6 | | - Write-Host "pwsh already installed, skipping" |
7 | | - return |
8 | | - } |
9 | | - $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' |
10 | | - Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1 |
11 | | - ./install-powershell.ps1 -Destination $powerShellPath |
12 | | - $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH" |
13 | | - Write-Host "sending " + $vstsCommandString |
14 | | - Write-Host "##$vstsCommandString" |
15 | | - displayName: Install PowerShell Core |
16 | | - |
17 | | -- pwsh: | |
18 | | - Get-ChildItem -Path env: |
19 | | - displayName: Capture environment |
20 | | - condition: succeededOrFailed() |
21 | | - |
22 | | -- task: PkgESSetupBuild@10 |
23 | | - displayName: 'Package ES - Setup Build' |
24 | | - inputs: |
25 | | - productName: PowerShellEditorServices |
26 | | - useDfs: false |
27 | 2 |
|
28 | 3 | - task: DownloadBuildArtifacts@0 |
29 | 4 | displayName: 'Download Build Artifacts' |
30 | 5 | inputs: |
31 | 6 | downloadType: specific |
32 | 7 |
|
33 | | -- task: PowerShell@1 |
34 | | - displayName: 'Extract build zip' |
35 | | - inputs: |
36 | | - scriptType: inlineScript |
37 | | - inlineScript: | |
38 | | - $dest = New-Item -ItemType Directory $env:BUILD_ARTIFACTSTAGINGDIRECTORY/release/out/PowerShellEditorServices |
39 | | - $psesZip = Get-ChildItem $env:BUILD_ARTIFACTSTAGINGDIRECTORY/PowerShellEditorServices-CI/PowerShellEditorServices*.zip -ErrorAction Stop |
40 | | - $psesZip | Expand-Archive -DestinationPath $dest -Force -Verbose |
41 | | - $psesZip | Remove-Item -Recurse -Force |
42 | | -
|
43 | | -- task: PkgESCodeSign@10 |
44 | | - displayName: 'CodeSign tools/releaseBuild/signing.xml' |
45 | | - env: |
46 | | - SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
47 | | - inputs: |
48 | | - signConfigXml: tools/releaseBuild/signing.xml |
49 | | - inPathRoot: '$(Build.ArtifactStagingDirectory)' |
50 | | - outPathRoot: '$(Build.ArtifactStagingDirectory)\Signed' |
51 | | - |
52 | | -- task: PowerShell@1 |
53 | | - displayName: 'Copy signed items into output' |
54 | | - inputs: |
55 | | - scriptType: inlineScript |
56 | | - inlineScript: | |
57 | | - $signed="$(Build.ArtifactStagingDirectory)\Signed\PowerShellEditorServices\*" |
58 | | - $notSigned="$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices" |
59 | | - Copy-Item $signed $notSigned -Recurse -Force |
60 | | -
|
61 | | -- task: PowerShell@1 |
62 | | - displayName: 'Create catalog files' |
63 | | - inputs: |
64 | | - scriptType: inlineScript |
65 | | - inlineScript: | |
66 | | - $dir = "$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices\PowerShellEditorServices" |
67 | | - New-FileCatalog -CatalogFilePath "$(Build.ArtifactStagingDirectory)\PowerShellEditorServices.cat" -Path $dir |
68 | | -
|
69 | | - $dir = "$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices\PowerShellEditorServices.VSCode" |
70 | | - New-FileCatalog -CatalogFilePath "$(Build.ArtifactStagingDirectory)\PowerShellEditorServices.VSCode.cat" -Path $dir |
71 | | -
|
72 | | -- task: PkgESCodeSign@10 |
73 | | - displayName: 'CodeSign tools/releaseBuild/FileCatalogSigning.xml' |
74 | | - env: |
75 | | - SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
76 | | - inputs: |
77 | | - signConfigXml: tools/releaseBuild/FileCatalogSigning.xml |
78 | | - inPathRoot: '$(Build.ArtifactStagingDirectory)' |
79 | | - outPathRoot: '$(Build.ArtifactStagingDirectory)' |
80 | | - |
81 | | -- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 |
82 | | - displayName: 'Component Detection' |
83 | | - |
84 | | -- task: AntiMalware@3 |
85 | | - inputs: |
86 | | - InputType: 'Basic' |
87 | | - ScanType: 'CustomScan' |
88 | | - FileDirPath: '$(Build.ArtifactStagingDirectory)' |
89 | | - EnableServices: false |
90 | | - SupportLogOnError: false |
91 | | - TreatSignatureUpdateFailureAs: 'Warning' |
92 | | - SignatureFreshness: 'UpToDate' |
93 | | - TreatStaleSignatureAs: 'Error' |
94 | | - |
95 | | -- task: PoliCheck@1 |
96 | | - condition: succeededOrFailed() |
97 | | - inputs: |
98 | | - targetType: F |
99 | | - optionsFC: 0 |
100 | | - optionsXS: 0 |
101 | | - optionsPE: '1|2|3|4' |
102 | | - optionsHMENABLE: 0 |
103 | | - optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml' |
104 | | - # toolVersion: 5.8.2.1 |
105 | | - |
106 | | -- task: CredScan@2 |
107 | | - condition: succeededOrFailed() |
108 | | - |
109 | | -# - task: BinSkim@3 |
110 | | -# condition: succeededOrFailed() |
111 | | -# inputs: |
112 | | -# InputType: 'Basic' |
113 | | -# Function: 'analyze' |
114 | | -# AnalyzeRecurse: true |
115 | | -# AnalyzeTarget: '$(Build.ArtifactStagingDirectory)\release;$(Build.ArtifactStagingDirectory)\OutGridView*.dll' |
116 | | - |
117 | | -# Publish results as artifacts |
118 | | -- task: PublishSecurityAnalysisLogs@3 |
119 | | - condition: succeededOrFailed() |
120 | | - inputs: |
121 | | - ArtifactName: 'CodeAnalysisLogs' |
122 | | - ArtifactType: 'Container' |
123 | | - |
124 | | -# Publish to TSA server |
125 | | -- task: TSAUpload@1 |
126 | | - condition: succeededOrFailed() |
127 | | - continueOnError: true |
128 | | - inputs: |
129 | | - tsaVersion: 'TsaV2' |
130 | | - codebase: 'Existing' |
131 | | - tsaEnvironment: 'PROD' |
132 | | - codeBaseName: 'PowerShell_PowerShellEditorServices_20190917' |
133 | | - uploadAPIScan: false |
134 | | - uploadBinSkim: false |
135 | | - uploadCredScan: true |
136 | | - uploadFortifySCA: false |
137 | | - uploadFxCop: false |
138 | | - uploadModernCop: false |
139 | | - uploadPoliCheck: true |
140 | | - uploadPREfast: false |
141 | | - uploadRoslyn: false |
142 | | - uploadTSLint: false |
143 | | - uploadAsync: true |
144 | | - |
145 | | -- task: PowerShell@1 |
146 | | - displayName: 'Upload artifacts' |
| 8 | +- task: ExtractFiles@1 |
| 9 | + displayName: 'Extract Build Zip' |
147 | 10 | inputs: |
148 | | - scriptType: inlineScript |
149 | | - inlineScript: 'Write-Host "##vso[artifact.upload containerfolder=PowerShellEditorServices;artifactname=PowerShellEditorServices]$(Build.ArtifactStagingDirectory)\release\out\PowerShellEditorServices"' |
| 11 | + archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/PowerShellEditorServices-CI/PowerShellEditorServices*.zip' |
| 12 | + destinationFolder: '$(Build.ArtifactStagingDirectory)/PowerShellEditorServices' |
| 13 | + |
| 14 | +- checkout: ComplianceRepo |
| 15 | + displayName: 'Checkout the ComplianceRepo' |
| 16 | + |
| 17 | +- template: EsrpSign.yml@ComplianceRepo |
| 18 | + parameters: |
| 19 | + buildOutputPath: '$(Build.ArtifactStagingDirectory)/PowerShellEditorServices' |
| 20 | + signOutputPath: '$(Build.ArtifactStagingDirectory)/FirstPartySigned' |
| 21 | + certificateId: 'CP-230012' # Authenticode certificate |
| 22 | + useMinimatch: true # This enables the use of globbing |
| 23 | + pattern: | |
| 24 | + # PowerShellEditorServices Script |
| 25 | + PowerShellEditorServices/*.{ps1,psd1,psm1,ps1xml} |
| 26 | + PowerShellEditorServices/Commands/**/*.{ps1,psd1,psm1,ps1xml} |
| 27 | + # PowerShellEditorServices Binaries |
| 28 | + PowerShellEditorServices/**/Microsoft.PowerShell.EditorServices*.dll |
| 29 | + # PowerShellEditorServices.VSCode Script |
| 30 | + PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1 |
| 31 | + # PowerShellEditorServices.VSCode Binary |
| 32 | + PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll |
| 33 | +
|
| 34 | +- template: EsrpSign.yml@ComplianceRepo |
| 35 | + parameters: |
| 36 | + buildOutputPath: '$(Build.ArtifactStagingDirectory)/FirstPartySigned' |
| 37 | + signOutputPath: '$(Build.ArtifactStagingDirectory)/ThirdPartySigned' |
| 38 | + certificateId: 'CP-231522' # Third-party certificate |
| 39 | + useMinimatch: true # This enables the use of globbing |
| 40 | + pattern: | |
| 41 | + **/MediatR.dll |
| 42 | + **/Nerdbank.Streams.dll |
| 43 | + **/Newtonsoft.Json.dll |
| 44 | + **/OmniSharp*.dll |
| 45 | + **/Serilog*.dll |
| 46 | + **/UnixConsoleEcho.dll |
| 47 | +
|
| 48 | +- publish: $(Build.ArtifactStagingDirectory)/ThirdPartySigned |
| 49 | + artifact: PowerShellEditorServices |
| 50 | + displayName: 'Publish signed (and unsigned) artifacts' |
| 51 | + |
| 52 | +- checkout: self |
| 53 | + |
| 54 | +- template: assembly-module-compliance.yml@ComplianceRepo |
| 55 | + parameters: |
| 56 | + # binskim |
| 57 | + AnalyzeTarget: '$(Build.ArtifactStagingDirectory)/*.dll' |
| 58 | + AnalyzeSymPath: 'SRV*' |
| 59 | + # component-governance |
| 60 | + sourceScanPath: '$(Build.SourcesDirectory)/PowerShellEditorServices' |
| 61 | + # credscan |
| 62 | + suppressionsFile: '' |
| 63 | + # TermCheck AKA PoliCheck |
| 64 | + targetArgument: '$(Build.SourcesDirectory)/PowerShellEditorServices' |
| 65 | + optionsUEPATH: '$(Build.SourcesDirectory)/PowerShellEditorServices/tools/terms/UserExclusions.xml' |
| 66 | + optionsRulesDBPath: '' |
| 67 | + optionsFTPath: '$(Build.SourcesDirectory)/PowerShellEditorServices/tools/terms/FileTypeSet.xml' |
| 68 | + # tsa-upload |
| 69 | + codeBaseName: 'PowerShell_PowerShellEditorServices_20210201' |
| 70 | + # selections |
| 71 | + APIScan: false |
0 commit comments