11steps :
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
2+ - checkout : self
163
174- pwsh : Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
185 displayName : Set Build Name for Non-PR
@@ -23,25 +10,20 @@ steps:
2310 displayName : Capture environment
2411 condition : succeededOrFailed()
2512
26- - task : PkgESSetupBuild@10
27- displayName : ' Package ES - Setup Build'
28- inputs :
29- productName : vscode-powershell
30- useDFS : false
31-
13+ # TODO: Use modern resources for these variables.
3214- task : PowerShell@2
3315 displayName : ' Set environment variables for VSTS (Phase 1)'
3416 inputs :
3517 targetType : filePath
36- filePath : ./tools/releaseBuild/setVstsVariables.ps1
18+ filePath : ./vscode-powershell/ tools/releaseBuild/setVstsVariables.ps1
3719
3820- task : PowerShell@2
3921 displayName : ' Find PowerShellEditorServices build'
4022 env :
4123 SYSTEM_ACCESSTOKEN : $(System.AccessToken)
4224 inputs :
4325 targetType : filePath
44- filePath : ./tools/releaseBuild/findPsesBuild.ps1
26+ filePath : ./vscode-powershell/ tools/releaseBuild/findPsesBuild.ps1
4527
4628- task : DownloadBuildArtifacts@0
4729 displayName : ' Download Build Artifacts from PowerShell Editor Services'
@@ -56,89 +38,55 @@ steps:
5638 downloadPath : ' $(Build.SourcesDirectory)'
5739
5840- pwsh : |
41+ New-Item -ItemType Directory $(Build.ArtifactStagingDirectory)/vscode-powershell
5942 Install-Module InvokeBuild -Force
6043 Invoke-Build Release
44+ workingDirectory : ' $(Build.SourcesDirectory)/vscode-powershell'
6145
6246- task : PublishTestResults@2
6347 inputs :
6448 testRunner : JUnit
6549 testResultsFiles : ' **/test-results.xml'
6650 condition : succeededOrFailed()
6751
68- - task : PkgESCodeSign@10
69- displayName : ' CodeSign tools/releaseBuild/signing.xml'
70- env :
71- SYSTEM_ACCESSTOKEN : $(System.AccessToken)
72- inputs :
73- signConfigXml : tools/releaseBuild/signing.xml
74- inPathRoot : ' $(Build.ArtifactStagingDirectory)'
75- outPathRoot : ' $(Build.ArtifactStagingDirectory)\Signed'
76-
77- - task : ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
78- displayName : ' Component Detection'
79-
80- - task : AntiMalware@3
81- inputs :
82- InputType : ' Basic'
83- ScanType : ' CustomScan'
84- FileDirPath : ' $(Build.ArtifactStagingDirectory)'
85- EnableServices : false
86- SupportLogOnError : false
87- TreatSignatureUpdateFailureAs : ' Warning'
88- SignatureFreshness : ' UpToDate'
89- TreatStaleSignatureAs : ' Error'
90-
91- - task : PoliCheck@1
92- condition : succeededOrFailed()
93- inputs :
94- targetType : F
95- optionsFC : 0
96- optionsXS : 0
97- optionsPE : ' 1|2|3|4'
98- optionsHMENABLE : 0
99- optionsFTPATH : ' $(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml'
100- # toolVersion: 5.8.2.1
101-
102- - pwsh : |
103- Get-ChildItem -Exclude node_modules | Get-ChildItem -Recurse | ForEach-Object FullName > "$env:BUILD_SOURCESDIRECTORY/credscan.tsv"
104- displayName : Create credscan.tsv as the list of files to scan
105-
106- - task : CredScan@2
107- condition : succeededOrFailed()
108- inputs :
109- debugMode : false
110- scanFolder : ' $(Build.SourcesDirectory)/credscan.tsv'
111-
112- # Publish results as artifacts
113- - task : PublishSecurityAnalysisLogs@3
114- condition : succeededOrFailed()
115- inputs :
116- ArtifactName : ' CodeAnalysisLogs'
117- ArtifactType : ' Container'
118-
119- # Publish to TSA server
120- - task : TSAUpload@1
121- condition : succeededOrFailed()
122- continueOnError : true
123- inputs :
124- tsaVersion : ' TsaV2'
125- codebase : ' Existing'
126- tsaEnvironment : ' PROD'
127- codeBaseName : ' PowerShell_PowerShellEditorServices_20190917'
128- uploadAPIScan : false
129- uploadBinSkim : false
130- uploadCredScan : true
131- uploadFortifySCA : false
132- uploadFxCop : false
133- uploadModernCop : false
134- uploadPoliCheck : true
135- uploadPREfast : false
136- uploadRoslyn : false
137- uploadTSLint : false
138- uploadAsync : true
139-
140- - task : PowerShell@1
141- displayName : ' Upload artifacts'
142- inputs :
143- scriptType : inlineScript
144- inlineScript : ' Write-Host "##vso[artifact.upload containerfolder=vscode-powershell;artifactname=vscode-powershell]$(System.ArtifactsDirectory)\Signed"'
52+ - checkout : ComplianceRepo
53+
54+ - template : EsrpSign.yml@ComplianceRepo
55+ parameters :
56+ buildOutputPath : ' $(Build.ArtifactStagingDirectory)/vscode-powershell'
57+ signOutputPath : ' $(Build.ArtifactStagingDirectory)/ScriptSigned'
58+ alwaysCopy : true # So publishing works
59+ certificateId : ' CP-230012' # Authenticode certificate
60+ useMinimatch : true # This enables the use of globbing
61+ pattern : |
62+ Install-VSCode.ps1
63+
64+ - template : EsrpSign.yml@ComplianceRepo
65+ parameters :
66+ buildOutputPath : ' $(Build.ArtifactStagingDirectory)/ScriptSigned'
67+ signOutputPath : ' $(Build.ArtifactStagingDirectory)/ExtensionSigned'
68+ alwaysCopy : true # So publishing works
69+ certificateId : ' CP-233016' # Microsoft OPC Publisher (VSIX) certificate
70+ useMinimatch : true # This enables the use of globbing
71+ pattern : |
72+ PowerShell-insiders.vsix
73+
74+ - publish : $(Build.ArtifactsDirectory)/ExtensionSigned
75+ artifact : vscode-powershell
76+ displayName : ' Publish signed (and unsigned) artifacts'
77+
78+ - template : script-module-compliance.yml@ComplianceRepo
79+ parameters :
80+ # component-governance
81+ sourceScanPath : ' $(Build.SourcesDirectory)/vscode-powershell'
82+ # credscan
83+ suppressionsFile : ' $(Build.SourcesDirectory)/vscode-powershell/tools/credScan/suppress.json'
84+ # TermCheck AKA PoliCheck
85+ targetArgument : ' $(Build.SourcesDirectory)/vscode-powershell'
86+ optionsUEPATH : ' $(Build.SourcesDirectory)/vscode-powershell/tools/terms/UserExclusions.xml'
87+ optionsRulesDBPath : ' '
88+ optionsFTPath : ' $(Build.SourcesDirectory)/vscode-powershell/tools/terms/FileTypeSet.xml'
89+ # tsa-upload
90+ codeBaseName : ' PowerShell_PowerShellEditorServices_20210201'
91+ # We don't use any Windows APIs directly, so we don't need API scan
92+ APIScan : false
0 commit comments