From 1ab41f4ea3b83d1de20aec7cc1f5e37d9360e346 Mon Sep 17 00:00:00 2001 From: "Shawn Yuan (from Dev Box)" Date: Tue, 9 Dec 2025 15:43:35 +0800 Subject: [PATCH] update Signed-off-by: Shawn Yuan (from Dev Box) --- .pipelines/UpdateVersions.ps1 | 13 +++++++------ .../steps-update-winappsdk-and-restore-nuget.yml | 15 --------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.pipelines/UpdateVersions.ps1 b/.pipelines/UpdateVersions.ps1 index 4b8b83f140..266e223ff8 100644 --- a/.pipelines/UpdateVersions.ps1 +++ b/.pipelines/UpdateVersions.ps1 @@ -95,13 +95,11 @@ if ($WinAppSDKVersion -match "^1\.8") { $installDir = Join-Path $rootPath "localpackages\output" New-Item -ItemType Directory -Path $installDir -Force | Out-Null - # Create a temporary nuget.config to avoid interference from the repo's config - $tempConfig = Join-Path $env:TEMP "nuget_$(Get-Random).config" - Set-Content -Path $tempConfig -Value "" + $nugetConfig = Join-Path $rootPath "nuget.config" try { # Download package to inspect nuspec and keep it for the build - $nugetArgs = "install Microsoft.WindowsAppSDK -Version $WinAppSDKVersion -ConfigFile $tempConfig -OutputDirectory $installDir -NonInteractive -NoCache" + $nugetArgs = "install Microsoft.WindowsAppSDK -Version $WinAppSDKVersion -ConfigFile ""$nugetConfig"" -OutputDirectory $installDir -NonInteractive -NoCache" Invoke-Expression "nuget $nugetArgs" | Out-Null # Parse dependencies from the installed folders @@ -117,8 +115,6 @@ if ($WinAppSDKVersion -match "^1\.8") { } } catch { Write-Warning "Failed to resolve dependencies: $_" - } finally { - Remove-Item $tempConfig -Force -ErrorAction SilentlyContinue } } @@ -151,5 +147,10 @@ Get-ChildItem -Path $rootPath -Recurse "Directory.Packages.props" | ForEach-Obje } } +if ($installDir -and (Test-Path $installDir)) { + Write-Host "Cleaning up installed packages..." + Remove-Item -Path $installDir -Recurse -Force +} + diff --git a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml index 418e0a8ea7..5c683f0b02 100644 --- a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml +++ b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml @@ -19,21 +19,6 @@ steps: -useExperimentalVersion $${{ parameters.useExperimentalVersion }} -rootPath "$(build.sourcesdirectory)" -- script: echo $(WinAppSDKVersion) - displayName: 'Display WinAppSDK Version Found' - -- task: NuGetAuthenticate@1 - displayName: 'NuGet Authenticate' - -- task: NuGetCommand@2 - displayName: 'Restore NuGet packages' - inputs: - command: 'restore' - feedsToUse: 'config' - nugetConfigPath: '$(build.sourcesdirectory)\nuget.config' - restoreSolution: '$(build.sourcesdirectory)\**\*.sln' - includeNuGetOrg: false - - task: NuGetCommand@2 displayName: 'Restore NuGet packages (slnx)' inputs: