diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index 73a257d6..8ba2c670 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -7,6 +7,14 @@ pr: - onebranch - release* +schedules: +- cron: '0 3 * * 1' + displayName: Weekly Build + branches: + include: + - main + always: true + variables: BuildConfiguration: 'release' PackageRoot: '$(System.ArtifactsDirectory)/Packages' @@ -25,9 +33,12 @@ extends: template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates parameters: featureFlags: - WindowsHostVersion: + WindowsHostVersion: Disk: Large - Version: 2022 + Version: 2022 + Network: KS3 # this retricts network access to public upstream repositories +# Currently can't be used as some NPM pkgs like tree-sitter-cli reach out to GitHub to get the actual zip pkg +# Network: NetLock customTags: 'ES365AIMigrationTooling' globalSdl: disableLegacyManifest: true @@ -48,7 +59,7 @@ extends: apiscan: enabled: false - stages: + stages: - stage: BuildAndSign displayName: Build Native Binaries dependsOn: [] diff --git a/build.ps1 b/build.ps1 index 8a64b8dc..8c877ef3 100644 --- a/build.ps1 +++ b/build.ps1 @@ -352,18 +352,29 @@ if (!$Clippy -and !$SkipBuild) { if ($Test) { $failed = $false + $usingADO = ($null -ne $env:TF_BUILD) + $repository = 'PSGallery' + + if ($usingADO) { + $repository = 'CFS' + if ($null -eq (Get-PSResourceRepository -Name CFS -ErrorAction Ignore)) { + "Registering CFS repository" + Register-PSResourceRepository -uri 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2' -Name CFS -Trusted + } + } + if ($IsWindows) { # PSDesiredStateConfiguration module is needed for Microsoft.Windows/WindowsPowerShell adapter $FullyQualifiedName = @{ModuleName="PSDesiredStateConfiguration";ModuleVersion="2.0.7"} if (-not(Get-Module -ListAvailable -FullyQualifiedName $FullyQualifiedName)) - { "Installing module PSDesiredStateConfiguration 2.0.7" - Install-PSResource -Name PSDesiredStateConfiguration -Version 2.0.7 -Repository PSGallery -TrustRepository + { + Install-PSResource -Name PSDesiredStateConfiguration -Version 2.0.7 -Repository $repository -TrustRepository } } if (-not(Get-Module -ListAvailable -Name Pester)) { "Installing module Pester" - Install-PSResource Pester -WarningAction Ignore -Repository PSGallery -TrustRepository + Install-PSResource Pester -WarningAction Ignore -Repository $repository -TrustRepository } foreach ($project in $projects) { @@ -408,7 +419,7 @@ if ($Test) { if (-not(Get-Module -ListAvailable -Name Pester)) { "Installing module Pester" $InstallTargetDir = ($env:PSModulePath -split ";")[0] - Find-PSResource -Name 'Pester' -Repository 'PSGallery' | Save-PSResource -Path $InstallTargetDir -TrustRepository + Find-PSResource -Name 'Pester' -Repository $repository | Save-PSResource -Path $InstallTargetDir -TrustRepository } "Updated Pester module location:" diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index 176c9844..3452b44b 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -469,7 +469,7 @@ dependencies = [ [[package]] name = "dsc" -version = "3.0.0-preview.9" +version = "3.0.0-preview.10" dependencies = [ "atty", "clap",