Skip to content

Commit ecfca5f

Browse files
committed
Fix Package task
This now leaves the VSIX named as `vsce` creates it: `powershell-YYYY.MM.X.vsix`, instead of renaming it `PowerShell-Insiders.vsix`. I can't think of anything this would break, since the upload is not actually done with the deleted `Upload` task but with an ADO pipeline task. This also fixes the path to `InvokePesterStub.ps1` which is now part of the PowerShellEditorServices repository. This was necessary in order to sign it, as it must be signed _before_ the VSIX is created. Moving it to the other repo was the best way to solve the "chicken-egg" problem that presented.
1 parent e287947 commit ecfca5f

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

.vsts-ci/templates/release-general.yml

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ steps:
4242
# NOTE: Code AKA *.vsix files are not signed
4343
pattern: |
4444
Install-VSCode.ps1
45-
InvokePesterStub.ps1
4645
4746
- template: EsrpScan.yml@ComplianceRepo
4847
parameters:

src/features/PesterTests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class PesterTestsFeature implements vscode.Disposable {
1818
private invokePesterStubScriptPath: string;
1919

2020
constructor(private sessionManager: SessionManager) {
21-
this.invokePesterStubScriptPath = path.resolve(__dirname, "../../../InvokePesterStub.ps1");
21+
this.invokePesterStubScriptPath = path.resolve(__dirname, "../../../modules/PowerShellEditorServices/InvokePesterStub.ps1");
2222

2323
// File context-menu command - Run Pester Tests
2424
this.command = vscode.commands.registerCommand(

vscode-powershell.build.ps1

+7-15
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices,
3636
}
3737
}
3838

39-
task UploadArtifacts {
40-
if ($env:TF_BUILD) {
41-
# SYSTEM_PHASENAME is the Job name.
42-
Copy-Item -Path PowerShell-insiders.vsix `
43-
-Destination "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/$($script:PackageJson.name)-$($script:PackageJson.version)-$env:SYSTEM_PHASENAME.vsix"
44-
}
45-
}
46-
4739
#endregion
4840
#region Restore tasks
4941

@@ -145,15 +137,15 @@ task Package UpdateReadme, {
145137
throw "Unable to find PowerShell EditorServices"
146138
}
147139

148-
Write-Host "`n### Packaging PowerShell-insiders.vsix`n" -ForegroundColor Green
140+
$packageName = "$($script:PackageJson.name)-$($script:PackageJson.version).vsix"
141+
Write-Host "`n### Packaging $packageName`n" -ForegroundColor Green
149142
exec { & node ./node_modules/vsce/out/vsce package --no-gitHubIssueLinking }
150143

151-
# Change the package to have a static name for automation purposes
152-
Move-Item -Force .\$($script:PackageJson.name)-$($script:PackageJson.version).vsix .\PowerShell-insiders.vsix
153-
154144
if ($env:TF_BUILD) {
155-
Copy-Item -Verbose -Recurse "./PowerShell-insiders.vsix" "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/vscode-powershell/PowerShell-insiders.vsix"
156-
Copy-Item -Verbose -Recurse "./scripts/Install-VSCode.ps1" "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/vscode-powershell/Install-VSCode.ps1"
145+
$artifactsPath = "$env:BUILD_ARTIFACTSTAGINGDIRECTORY/vscode-powershell/"
146+
"./$packageName", "./scripts/Install-VSCode.ps1" | ForEach-Object {
147+
Copy-Item -Verbose -Recurse $_ $artifactsPath
148+
}
157149
}
158150
}
159151

@@ -162,4 +154,4 @@ task Package UpdateReadme, {
162154
# The set of tasks for a release
163155
task Release Clean, Build, Package
164156
# The default task is to run the entire CI build
165-
task . CleanAll, BuildAll, Test, Package, UploadArtifacts
157+
task . CleanAll, BuildAll, Test, Package

0 commit comments

Comments
 (0)