Skip to content

Commit

Permalink
Reorganize build and packages to allow for omitting dev tools
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
andyleejordan committed Aug 22, 2024
1 parent d69ee8a commit af55b91
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 365 deletions.
41 changes: 16 additions & 25 deletions .pipelines/vscode-powershell-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ parameters:
variables:
system.debug: ${{ parameters.debug }}
BuildConfiguration: Release
WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2022/vse2022:latest

resources:
repositories:
Expand All @@ -50,6 +50,10 @@ extends:
asyncSdl:
enabled: true
forStages: [build]
featureFlags:
WindowsHostVersion:
Version: 2022
Network: Netlock
stages:
- stage: build
jobs:
Expand All @@ -75,30 +79,21 @@ extends:
inputs:
system: Custom
customVersion: $(package.version)
- task: UseNode@1
displayName: Use Node 18.x
inputs:
version: 18.x
- task: PowerShell@2
displayName: Install PSResources
inputs:
pwsh: true
filePath: tools/installPSResources.ps1
- task: DownloadPipelineArtifact@2
displayName: Download PowerShellEditorServices
inputs:
source: specific
project: PowerShellCore
definition: 2905
specificBuildWithTriggering: true
artifact: drop_release_github
itemPattern: PowerShellEditorServices.zip
- task: ExtractFiles@1
displayName: Extract PowerShellEditorServices module
inputs:
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip
destinationFolder: $(Build.SourcesDirectory)/modules
- pwsh: Invoke-Build Build -Configuration $(BuildConfiguration)
branchName: refs/heads/main
artifact: drop_build_main
targetPath: $(Build.SourcesDirectory)/modules
- pwsh: |
Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted
Install-Module -Name InvokeBuild -Repository CFS -RequiredVersion 5.11.3 -Verbose
Invoke-Build Build -Configuration $(BuildConfiguration)
# TODO: When the OneBuild container updates to 7.4, update to PSResourceGet
displayName: Build
- task: onebranch.pipeline.signing@1
displayName: Sign 1st-party example PowerShell files
Expand Down Expand Up @@ -141,13 +136,9 @@ extends:
project: PowerShellCore
definition: 2905
specificBuildWithTriggering: true
artifact: drop_release_github
itemPattern: PowerShellEditorServices.zip
- task: ExtractFiles@1
displayName: Extract PowerShellEditorServices module
inputs:
archiveFilePatterns: $(Pipeline.Workspace)/PowerShellEditorServices.zip
destinationFolder: $(Build.SourcesDirectory)/modules
branchName: refs/heads/main
artifact: drop_build_main
targetPath: $(Build.SourcesDirectory)/modules
- pwsh: Invoke-Build Test -Configuration $(BuildConfiguration)
displayName: Run tests
- stage: release
Expand Down
Loading

0 comments on commit af55b91

Please sign in to comment.