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
2
+ - checkout : self
16
3
17
4
- pwsh : Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
18
5
displayName : Set Build Name for Non-PR
@@ -23,25 +10,20 @@ steps:
23
10
displayName : Capture environment
24
11
condition : succeededOrFailed()
25
12
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.
32
14
- task : PowerShell@2
33
15
displayName : ' Set environment variables for VSTS (Phase 1)'
34
16
inputs :
35
17
targetType : filePath
36
- filePath : ./tools/releaseBuild/setVstsVariables.ps1
18
+ filePath : ./vscode-powershell/ tools/releaseBuild/setVstsVariables.ps1
37
19
38
20
- task : PowerShell@2
39
21
displayName : ' Find PowerShellEditorServices build'
40
22
env :
41
23
SYSTEM_ACCESSTOKEN : $(System.AccessToken)
42
24
inputs :
43
25
targetType : filePath
44
- filePath : ./tools/releaseBuild/findPsesBuild.ps1
26
+ filePath : ./vscode-powershell/ tools/releaseBuild/findPsesBuild.ps1
45
27
46
28
- task : DownloadBuildArtifacts@0
47
29
displayName : ' Download Build Artifacts from PowerShell Editor Services'
@@ -56,89 +38,55 @@ steps:
56
38
downloadPath : ' $(Build.SourcesDirectory)'
57
39
58
40
- pwsh : |
41
+ New-Item -ItemType Directory $(Build.ArtifactStagingDirectory)/vscode-powershell
59
42
Install-Module InvokeBuild -Force
60
43
Invoke-Build Release
44
+ workingDirectory : ' $(Build.SourcesDirectory)/vscode-powershell'
61
45
62
46
- task : PublishTestResults@2
63
47
inputs :
64
48
testRunner : JUnit
65
49
testResultsFiles : ' **/test-results.xml'
66
50
condition : succeededOrFailed()
67
51
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