-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add New CI Pipeline for Latest WindowsAppSDK #36282
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Shawn Yuan <[email protected]>
Signed-off-by: Shawn Yuan <[email protected]>
Signed-off-by: Shawn Yuan <[email protected]>
Signed-off-by: Shawn Yuan <[email protected]>
Signed-off-by: Shawn Yuan <[email protected]>
Signed-off-by: Shawn Yuan <[email protected]>
Pipeline can now specify the version of winappsdk to be used. change to daily midnight build
Hi, we've added the "Don't Merge" tag to the PR, since we're trying to keep the repo stable for the release and possible hotfix if necessary. Please don't merge the PR while the tag is still in here. This allows people to review the PR and approve with less fear that it'll get merged 😄 |
…be verified Signed-off-by: Shawn Yuan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change, overall looks good, have minor comments.
@@ -233,10 +254,16 @@ jobs: | |||
inputs: | |||
solution: '**\HostsUILib.csproj' | |||
vsVersion: 17.0 | |||
${{ if eq(parameters.useVSPreview, true) }}: | |||
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-hosts.binlog /p:NoWarn=NU5104 | |||
${{ if or(eq(parameters.useVSPreview, true), eq(parameters.useLatestWinAppSDK, true)) }}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, with this, we can make it as single line then.
Since I see there is no security concern for "making up the build parameters", as the result, we can directly like WITHOUT IF ELSE
msbuildArgs: >-
/p:CIBuild=true;NoBuild=true -t:pack
/bl:$(LogOutputDirectory)\build-hosts.binlog
$(MSBuildArgs.UseVSPreview)
$(RestoreAdditionalProjectSourcesArg)
.pipelines/UpdateVersions.ps1
Outdated
[string]$versionNumber = "1.6", | ||
|
||
#[Parameter(Mandatory=$False,Position=2)] | ||
[string]$useExperimentalVersion = "false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to be string instead of boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the pipeline calls the PS1 file, the passed parameters are converted to string type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is unexpected.
You can pass any type of PowerShell object to a script in a pipeline.
pwsh: |-
& ./Path/To/Script.ps1 -BooleanArgunent $true
If you need to convert an azure DevOps yaml boolean into a PowerShell boolean, you can use...
$${{parameters.azureDevopsYamlBoolean}}
This will evaluate to $true
or $false
(the first $ is for PowerShell, and the second one is for Azure DevOps!)
.pipelines/UpdateVersions.ps1
Outdated
# print nuget.config after modification | ||
$xml.OuterXml | ||
# Save the modified nuget.config file | ||
$xml.Save($filePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these big chunk of code, would you mind to break it down into smaller functions?
As the result, the main one will looks cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.
function Update-PackageConfig {
param (
[string]$filePath,
[string]$oldVersionString,
[string]$newVersionString
)
# Function implementation
}
Signed-off-by: Shawn Yuan <[email protected]>
Signed-off-by: Shawn Yuan <[email protected]>
Summary
The old PR cannot be reopened, so I create a new PR
This PR introduces the following changes to the CI pipeline and version management:
Pipeline Enhancements:
UpdateVersions.ps1
to automate the update ofMicrosoft.WindowsAppSDK
versions across various project files.ci-using-the-latest-winappsdk.yml
to build using the latestMicrosoft.WindowsAppSDK
.useLatestWinAppSDK
parameter.Pipeline Configuration Updates:
job-build-project.yml
to handle theuseLatestWinAppSDK
parameter and adjust theRestoreAdditionalProjectSourcesArg
accordingly.steps-update-winappsdk-and-restore-nuget.yml
for updating and restoring NuGet packages with the latestMicrosoft.WindowsAppSDK
.PR Checklist
Detailed Description of the Pull Request / Additional comments
Changes
New Files
.pipelines/UpdateVersions.ps1
: Script to updateMicrosoft.WindowsAppSDK
versions..pipelines/v2/ci-using-the-latest-winappsdk.yml
: New pipeline configuration for using the latestMicrosoft.WindowsAppSDK
..pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml
: Template for updating and restoring NuGet packages.Modified Files
.pipelines/v2/templates/job-build-project.yml
: Updated to handleuseLatestWinAppSDK
parameter and adjust MSBuild arguments..pipelines/v2/templates/pipeline-ci-build.yml
: AddeduseLatestWinAppSDK
parameter.Validation Steps Performed
.pipelines/UpdateVersions.ps1
script correctly updates theMicrosoft.WindowsAppSDK
versions in the relevant project files.Microsoft.WindowsAppSDK
.verifyNoticeMdAgainstNugetPackages.ps1
based on theuseLatestWinAppSDK
parameter.