@@ -65,51 +65,52 @@ jobs:
6565 workingDirectory: $(dir-name)
6666 env:
6767 SignType: ${{ parameters.SignType }}
68+ - template : list-file-structure.yaml
6869 - script : dotnet build msbuild/signVsix -v:normal
6970 displayName : 🖊️ Sign VSIXes
7071 env :
7172 SignType : ${{ parameters.SignType }}
72- - pwsh : |
73- Function Spawn-Tool($command, $commandArgs, $retryCount=0) {
74- Write-Host "$pwd >"
75- for (; $retryCount -ge 0; $retryCount--) {
76- Write-Host "##[command]$command $commandArgs"
77- $output = Invoke-Expression "$command $commandArgs" # Do not use @commandArgs because it quotes '-Target', breaking the script.
78- if ($LASTEXITCODE -eq 0) { break }
79- Write-Host "Task failed with exit code $LASTEXITCODE. $retryCount retries left."
80- }
81- if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
73+ - ${{ if eq(variables['Build.Reason'], 'IndividualCI') }} :
74+ - pwsh : |
75+ Function Spawn-Tool($command, $commandArgs, $retryCount=0) {
76+ Write-Host "$pwd >"
77+ for (; $retryCount -ge 0; $retryCount--) {
78+ Write-Host "##[command]$command $commandArgs"
79+ $output = Invoke-Expression "$command $commandArgs" # Do not use @commandArgs because it quotes '-Target', breaking the script.
80+ if ($LASTEXITCODE -eq 0) { break }
81+ Write-Host "Task failed with exit code $LASTEXITCODE. $retryCount retries left."
82+ }
83+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
8284
83- return $output
84- }
85+ return $output
86+ }
8587
86- $anyFailed = $false
87- $vsixes = Get-ChildItem -Path ../packages -Filter *.vsix -Recurse
88- foreach ($vsix in $vsixes) {
89- $baseName = "$($vsix.DirectoryName)\$($vsix.BaseName)"
90- $manifestFile = $baseName + ".manifest"
91- $signatureFile = $baseName + ".signature.p7s"
88+ $anyFailed = $false
89+ $vsixes = Get-ChildItem -Path ../packages -Filter *.vsix -Recurse
90+ foreach ($vsix in $vsixes) {
91+ $baseName = "$($vsix.DirectoryName)\$($vsix.BaseName)"
92+ $manifestFile = $baseName + ".manifest"
93+ $signatureFile = $baseName + ".signature.p7s"
9294
93- $vsceVerifyArgs = '@vscode/vsce','verify-signature','--packagePath',$vsix,'--manifestPath',$manifestFile,'--signaturePath',$signatureFile
94- $output = Spawn-Tool 'npx' $vsceVerifyArgs
95+ $vsceVerifyArgs = '@vscode/vsce','verify-signature','--packagePath',$vsix,'--manifestPath',$manifestFile,'--signaturePath',$signatureFile
96+ $output = Spawn-Tool 'npx' $vsceVerifyArgs
9597
96- # This is a brittle check but the command does not return a non-zero exit code for failed validation.
97- # Opened https://github.com/microsoft/vscode-vsce/issues/1192 to track this.
98- if ($output.Contains('Signature verification result: Success')) {
99- Write-Host "Signature verification succeeded for $vsix"
100- } else {
101- Write-Host ($output | Out-String)
102- Write-Host "##[error]Signature verification failed for $vsix"
103- $anyFailed = $true
98+ # This is a brittle check but the command does not return a non-zero exit code for failed validation.
99+ # Opened https://github.com/microsoft/vscode-vsce/issues/1192 to track this.
100+ if ($output.Contains('Signature verification result: Success')) {
101+ Write-Host "Signature verification succeeded for $vsix"
102+ } else {
103+ Write-Host ($output | Out-String)
104+ Write-Host "##[error]Signature verification failed for $vsix"
105+ $anyFailed = $true
106+ }
104107 }
105- }
106108
107- if ($anyFailed) {
108- exit 1
109- }
110- displayName: 🔑 Verify VSIX Signature Files
111- workingDirectory: $(dir-name)
112- condition: and( succeeded(), eq('$(SignType)', 'Real'))
109+ if ($anyFailed) {
110+ exit 1
111+ }
112+ displayName: 🔑 Verify VSIX Signature Files
113+ workingDirectory: $(dir-name)
113114 - task : CmdLine@2
114115 displayName : 🤌 Rename Signed VSIX
115116 inputs :
0 commit comments