Skip to content

Commit efd6fd5

Browse files
committed
Reorganize build and packages to allow for omitting dev tools
New requirements in our release pipeline require us to omit the installation of quite a few of our (optional) dev tools, as their post-install tasks reach out to the public NPM registry and so are blocked. By moving everything except `esbuild` and `vsce` to `optionalDependencies` (and reorganzing the build script) we can run the linter and tests outside of the secure container. Since OneBranch and GitHub Actions are now using PowerShell 7.4, the module setup script had to be updated. Because OneBranch now runs without releasing, the downloaded drop had to change (skipping a zip and extraction).
1 parent d69ee8a commit efd6fd5

File tree

5 files changed

+358
-365
lines changed

5 files changed

+358
-365
lines changed

.pipelines/vscode-powershell-Official.yml

+18-25
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ parameters:
2727
variables:
2828
system.debug: ${{ parameters.debug }}
2929
BuildConfiguration: Release
30-
WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
30+
WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2022/vse2022:latest
3131

3232
resources:
3333
repositories:
@@ -41,6 +41,8 @@ resources:
4141
trigger:
4242
branches:
4343
- main
44+
stages:
45+
- release
4446

4547
extends:
4648
# https://aka.ms/obpipelines/templates
@@ -50,6 +52,10 @@ extends:
5052
asyncSdl:
5153
enabled: true
5254
forStages: [build]
55+
featureFlags:
56+
WindowsHostVersion:
57+
Version: 2022
58+
Network: Netlock
5359
stages:
5460
- stage: build
5561
jobs:
@@ -75,30 +81,21 @@ extends:
7581
inputs:
7682
system: Custom
7783
customVersion: $(package.version)
78-
- task: UseNode@1
79-
displayName: Use Node 18.x
80-
inputs:
81-
version: 18.x
82-
- task: PowerShell@2
83-
displayName: Install PSResources
84-
inputs:
85-
pwsh: true
86-
filePath: tools/installPSResources.ps1
8784
- task: DownloadPipelineArtifact@2
8885
displayName: Download PowerShellEditorServices
8986
inputs:
9087
source: specific
9188
project: PowerShellCore
9289
definition: 2905
9390
specificBuildWithTriggering: true
94-
artifact: drop_release_github
95-
itemPattern: PowerShellEditorServices.zip
96-
- task: ExtractFiles@1
97-
displayName: Extract PowerShellEditorServices module
98-
inputs:
99-
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip
100-
destinationFolder: $(Build.SourcesDirectory)/modules
101-
- pwsh: Invoke-Build Build -Configuration $(BuildConfiguration)
91+
branchName: refs/heads/main
92+
artifact: drop_build_main
93+
targetPath: $(Build.SourcesDirectory)/modules
94+
- pwsh: |
95+
Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted
96+
Install-Module -Name InvokeBuild -Repository CFS -RequiredVersion 5.11.3 -Verbose
97+
Invoke-Build Build -Configuration $(BuildConfiguration)
98+
# TODO: When the OneBuild container updates to 7.4, update to PSResourceGet
10299
displayName: Build
103100
- task: onebranch.pipeline.signing@1
104101
displayName: Sign 1st-party example PowerShell files
@@ -141,13 +138,9 @@ extends:
141138
project: PowerShellCore
142139
definition: 2905
143140
specificBuildWithTriggering: true
144-
artifact: drop_release_github
145-
itemPattern: PowerShellEditorServices.zip
146-
- task: ExtractFiles@1
147-
displayName: Extract PowerShellEditorServices module
148-
inputs:
149-
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip
150-
destinationFolder: $(Build.SourcesDirectory)/modules
141+
branchName: refs/heads/main
142+
artifact: drop_build_main
143+
targetPath: $(Build.SourcesDirectory)/modules
151144
- pwsh: Invoke-Build Test -Configuration $(BuildConfiguration)
152145
displayName: Run tests
153146
- stage: release

0 commit comments

Comments
 (0)