diff --git a/.pipelines/v2/ci-using-the-latest-winappsdk.yml b/.pipelines/v2/ci-using-the-latest-winappsdk.yml index 4a2155f12b..fbab606360 100644 --- a/.pipelines/v2/ci-using-the-latest-winappsdk.yml +++ b/.pipelines/v2/ci-using-the-latest-winappsdk.yml @@ -39,7 +39,7 @@ parameters: default: false - name: useUnstableWinAppSDK type: boolean - displayName: "Use Unstable WinAppSDK Package (even if build failed)" + displayName: "Allow using unstable WinAppSDK package (even if build failed)" default: false extends: 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 7c9778817d..6cd7273559 100644 --- a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml +++ b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml @@ -25,22 +25,52 @@ steps: - script: echo $(WinAppSDKVersion) displayName: 'Display WinAppSDK Version Found' -- task: DownloadPipelineArtifact@2 - displayName: 'Download WindowsAppSDK' +- task: PowerShell@2 + displayName: 'Query Available WinAppSDK Packages' inputs: - buildType: 'specific' - project: '55e8140e-57ac-4e5f-8f9c-c7c15b51929d' - definition: '104083' - allowPartiallySucceededBuilds: ${{ parameters.useUnstableWinAppSDK }} - allowFailedBuilds: ${{ parameters.useUnstableWinAppSDK }} - buildVersionToDownload: 'latestFromBranch' - branchName: 'refs/heads/release/${{ parameters.versionNumber }}-stable' - artifactName: 'WindowsAppSDK_Nuget_And_MSIX' - targetPath: '$(Build.SourcesDirectory)\localpackages' + targetType: 'inline' + script: | + Write-Host "Querying available Microsoft.WindowsAppSDK packages..." + $prereleaseFlag = if ('${{ parameters.useExperimentalVersion }}' -eq 'true') { '-Prerelease' } else { '' } + $command = "nuget list Microsoft.WindowsAppSDK -Source `"https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json`" $prereleaseFlag" + Write-Host "Command: $command" + Invoke-Expression $command -- script: dir $(Build.SourcesDirectory)\localpackages\NugetPackages +- task: NuGetCommand@2 + displayName: 'Download WindowsAppSDK directly from NuGet' + condition: eq('${{ parameters.useUnstableWinAppSDK }}', 'true') + inputs: + command: 'custom' + arguments: > + install "Microsoft.WindowsAppSDK" + -Source "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json" + -Version "$(WinAppSDKVersion)" + -OutputDirectory "$(Build.SourcesDirectory)\localpackages\direct" + ${{ eq(parameters.useExperimentalVersion, true) and '-Prerelease' or '' }} + +- script: | + echo "Listing packages from direct download:" + if exist "$(Build.SourcesDirectory)\localpackages\direct" dir "$(Build.SourcesDirectory)\localpackages\direct" + echo "Listing packages from pipeline download:" + if exist "$(Build.SourcesDirectory)\localpackages\NugetPackages" dir "$(Build.SourcesDirectory)\localpackages\NugetPackages" displayName: 'List downloaded packages' +# - task: DownloadPipelineArtifact@2 +# displayName: 'Download WindowsAppSDK' +# inputs: +# buildType: 'specific' +# project: '55e8140e-57ac-4e5f-8f9c-c7c15b51929d' +# definition: '104083' +# allowPartiallySucceededBuilds: ${{ parameters.useUnstableWinAppSDK }} +# allowFailedBuilds: ${{ parameters.useUnstableWinAppSDK }} +# buildVersionToDownload: 'latestFromBranch' +# branchName: 'refs/heads/release/${{ parameters.versionNumber }}-stable' +# artifactName: 'WindowsAppSDK_Nuget_And_MSIX' +# targetPath: '$(Build.SourcesDirectory)\localpackages' + +# - script: dir $(Build.SourcesDirectory)\localpackages\NugetPackages +# displayName: 'List downloaded packages' + - task: NuGetCommand@2 displayName: 'Install WindowsAppSDK' inputs: