1
1
steps :
2
- - checkout : self
3
-
4
- - powershell : |
5
- Write-Host "Installing pwsh..."
6
- if (Get-Command pwsh -ErrorAction Ignore)
7
- {
8
- Write-Host "pwsh already installed, skipping"
9
- return
10
- }
11
- $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
12
- Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 -outfile ./install-powershell.ps1
13
- ./install-powershell.ps1 -Destination $powerShellPath
14
- $vstsCommandString = "vso[task.setvariable variable=PATH]$powerShellPath;$env:PATH"
15
- Write-Host "sending " + $vstsCommandString
16
- Write-Host "##$vstsCommandString"
17
- displayName : Install PowerShell Core
18
-
19
- - pwsh : |
20
- Get-ChildItem -Path env:
21
- displayName : Capture environment
22
- condition : succeededOrFailed()
23
2
24
3
- task : DownloadBuildArtifacts@0
25
4
displayName : ' Download Build Artifacts'
26
5
inputs :
27
6
downloadType : specific
28
7
29
- # TODO: Use `ExtractFiles` task instead of script
30
- - task : PowerShell@1
31
- displayName : ' Extract build zip'
8
+ - task : ExtractFiles@1
9
+ displayName : ' Extract Build Zip'
32
10
inputs :
33
- scriptType : inlineScript
34
- inlineScript : |
35
- $dest = New-Item -ItemType Directory $env:BUILD_ARTIFACTSTAGINGDIRECTORY/PowerShellEditorServices
36
- $psesZip = Get-ChildItem $env:BUILD_ARTIFACTSTAGINGDIRECTORY/PowerShellEditorServices-CI/PowerShellEditorServices*.zip -ErrorAction Stop
37
- $psesZip | Expand-Archive -DestinationPath $dest -Force -Verbose
38
- $psesZip | Remove-Item -Recurse -Force
11
+ archiveFilePatterns : ' $(Build.ArtifactStagingDirectory)/PowerShellEditorServices-CI/PowerShellEditorServices*.zip'
12
+ destinationFolder : ' $(Build.ArtifactStagingDirectory)/PowerShellEditorServices'
39
13
40
14
- checkout : ComplianceRepo
15
+ displayName : ' Checkout the ComplianceRepo'
41
16
42
17
- template : EsrpSign.yml@ComplianceRepo
43
18
parameters :
19
+ # NOTE: All artifacts are copied to "Signed" even though only some are
20
+ # actually signed. We then publish this folder below.
44
21
buildOutputPath : ' $(Build.ArtifactStagingDirectory)/PowerShellEditorServices'
45
22
signOutputPath : ' $(Build.ArtifactStagingDirectory)/Signed'
46
23
certificateId : ' CP-230012' # Authenticode certificate.
@@ -56,6 +33,10 @@ steps:
56
33
# PowerShellEditorServices.VSCode Binary
57
34
PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll
58
35
36
+ - publish : $(Build.ArtifactStagingDirectory)/Signed
37
+ artifact : PowerShellEditorServices
38
+ displayName : ' Publish signed (and unsigned) artifacts'
39
+
59
40
# TODO: Use templates for compliance checks
60
41
- task : ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
61
42
displayName : ' Component Detection'
@@ -120,10 +101,3 @@ steps:
120
101
uploadRoslyn : false
121
102
uploadTSLint : false
122
103
uploadAsync : true
123
-
124
- # TODO: Use `publish` task instead of script
125
- - task : PowerShell@1
126
- displayName : ' Upload artifacts'
127
- inputs :
128
- scriptType : inlineScript
129
- inlineScript : ' Write-Host "##vso[artifact.upload containerfolder=PowerShellEditorServices;artifactname=PowerShellEditorServices]$(Build.ArtifactStagingDirectory)/Signed/PowerShellEditorServices"'
0 commit comments