microsoft / github-actions-for-desktop-apps

This repo contains a sample WPF application to demonstrate how to create CI/CD pipelines using GitHub Actions.
MIT License
352 stars 109 forks source link

.NET 6 Update #42

Closed LanceMcCarthy closed 9 months ago

LanceMcCarthy commented 3 years ago

There have been a lot of changes since .NET Core 3 for WPF and packaging projects. .NET 5/6 have many improvements and has a different project style and structure.

This enhancement is to migrate the existing .NET Core 3 project type to .NET 5 and use the improved interconnect in Project Reunion (aka Windows App SDK), SDK contracts and CsWinRT.

@edwardskrod These changes have been implemented in the lance/net5-update branch. Can you review for initial approval? If it looks good to you, I will write a new temporary workflow to start CI-CD improvements.

LanceMcCarthy commented 3 years ago

Since .NET 6 is being released tomorrow, I have changed the target of this Enhancement to .NET 6 instead of .NET 5.

If someone is looking for a .NET 5 workflow, they can use the same .NET 6 example for guidance.

LanceMcCarthy commented 3 years ago

Side Task - Also I should migrate this to a single-project MSIX at the same time. There is no longer a need to have a 2nd "PackageProject" adding complexity to the solution

LanceMcCarthy commented 2 years ago

Updates

I'm closing in on wrapping up the migration to .NET 6. Please visit the lance/net6-update branch to follow along.

Code

All projects have been successfully updated to .NET 6! It took a few different migrations as project structure and dependencies were different back in the NETCore 3.x days

Workflows

In order for me to fully complete the workflow updates, I am wait for an update code signing certificate from Microsoft. The one we currently use has expired. In the meantime, I have inserted a temporary self-signed certificate step in the workflow to be a temporary placeholder.

Single-project MSIX

This is not yet possible for WPF projects. Single-project MSIX is only supported for WinUI3/Windows app SDK project types

Technically, you can generate the MSIX with unsupported msbuild command, but you need to manually bundle and sign it. You can find another project that I currently experimenting with this https://github.com/LanceMcCarthy/MediaFileManager/blob/main-dev/.github/workflows/ci_dev.yml

mr-j0nes commented 10 months ago

Hello. After 2 years is there any plan to implement the code for .NET 6?

LanceMcCarthy commented 9 months ago

Hi @mr-j0nes Yeah, the demand to convert this to .NET 6/7/8 has been low, particularly since "single-project MSIX" is an option for WPF apps now.

Instead, there is a separate project that shows you how to achieve it. See https://github.com/andrewleader/WindowsAppSDKGallery/blob/main/.github/workflows/dotnet-desktop.yml. Specifically Line 102 has the build & package MSBuild command.

If that doesn't help you, I can revisit this effort and jump right to .NET 8.

mr-j0nes commented 9 months ago

Thank you very much. This helps. We can close this issue.

LanceMcCarthy commented 9 months ago

Closed as Not Planned, but can be re-opened with enough interest.