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 23, 2024
1 parent d69ee8a commit efd6fd5
Show file tree
Hide file tree
Showing 5 changed files with 358 additions and 365 deletions.
43 changes: 18 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 @@ -41,6 +41,8 @@ resources:
trigger:
branches:
- main
stages:
- release

extends:
# https://aka.ms/obpipelines/templates
Expand All @@ -50,6 +52,10 @@ extends:
asyncSdl:
enabled: true
forStages: [build]
featureFlags:
WindowsHostVersion:
Version: 2022
Network: Netlock
stages:
- stage: build
jobs:
Expand All @@ -75,30 +81,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 +138,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

3 comments on commit efd6fd5

@JustinGrote
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @andyleejordan I think you broke something here, all subsequent builds have been hanging at the debug adapter step.
image

@andyleejordan
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JustinGrote hm, strange, it passed when it merged this incoming WIP PR is passing: https://github.com/PowerShell/vscode-powershell/actions/runs/10840756167

@JustinGrote
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyleejordan transient issue maybe?

Please sign in to comment.