diff options
| author | Matt <[email protected]> | 2024-06-24 11:14:36 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-24 11:14:36 -0700 |
| commit | e59949f40da211f378e8f76bee383506d9b97243 (patch) | |
| tree | e87800c55626a907a89eb6233f387fc4727c13b5 /Build-SampleSet.ps1 | |
| parent | dbfbeada993778d718d8ac829d8f496ee015d5e2 (diff) | |
CI Pipelines build with WDK Nuget Packages (#1179)
Integrate nuget into the workflow pipelines
Diffstat (limited to 'Build-SampleSet.ps1')
| -rw-r--r-- | Build-SampleSet.ps1 | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index b0da097a..2197b967 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -9,6 +9,17 @@ param( ) $root = Get-Location + +# launch developer powershell (if necessary) +if (-not $env:VSCMD_VER) { + Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") + Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") + cd $root +} + +# source environment variables +. .\Env-Vars.ps1 + $ThrottleFactor = 5 $LogicalProcessors = (Get-CIMInstance -Class 'CIM_Processor' -Verbose:$false).NumberOfLogicalProcessors @@ -51,21 +62,20 @@ finally { $build_environment="" $build_number=0 # -# WDK NuGet will require presence of a folder 'packages' +# In Github we build using Nuget only and source version from repo .\Env-Vars.ps1. # -# -# Hack: In GitHub we do not have an environment variable where we can see WDK build number, so we have it hard coded. -# -if (-not $env:GITHUB_REPOSITORY -eq '') { +if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" - $build_number=22621 + $build_number=$env:SAMPLES_BUILD_NUMBER } # +# WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. +# # Hack: If user has hydrated nuget packages, then use those. That will be indicated by presence of a folder named .\packages. # elseif(Test-Path(".\packages")) { $build_environment=("NuGet") - $build_number=26100 + $build_number=$env:SAMPLES_BUILD_NUMBER } # # EWDK sets environment variable BuildLab. For example 'ni_release_svc_prod1.22621.2428'. |
