Skip to content

Add GitHub Actions workflow for .NET Core Desktop#2384

Open
jarlungoodoo73 wants to merge 1 commit into
git-ecosystem:mainfrom
jarlungoodoo73:jarlungoodoo73-patch-1
Open

Add GitHub Actions workflow for .NET Core Desktop#2384
jarlungoodoo73 wants to merge 1 commit into
git-ecosystem:mainfrom
jarlungoodoo73:jarlungoodoo73-patch-1

Conversation

@jarlungoodoo73

Copy link
Copy Markdown

This workflow builds, tests, signs, and packages a .NET Core desktop application, specifically for WPF or Windows Forms. It includes steps for setting up the environment, restoring the application, and handling signing certificates.

This workflow builds, tests, signs, and packages a .NET Core desktop application, specifically for WPF or Windows Forms. It includes steps for setting up the environment, restoring the application, and handling signing certificates.
@jarlungoodoo73
jarlungoodoo73 requested a review from a team as a code owner July 16, 2026 21:34
Copilot AI review requested due to automatic review settings July 16, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Actions workflow intended to build, test, sign, and package a .NET “desktop” application on Windows runners.

Changes:

  • Introduces .github/workflows/dotnet-desktop.yml with a Windows build job and Debug/Release matrix.
  • Adds signing certificate decode + MSIX packaging steps and uploads build artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +58 to +62
env:
Solution_Name: your-solution-name # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
Comment on lines +71 to +74
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
Comment on lines +80 to +83
# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test

Comment on lines +90 to +96
# Decode the base 64 encoded pfx and save the Signing_Certificate
- name: Decode the pfx
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
$certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)

Comment on lines +97 to +104
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
env:
Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64
Appx_Package_Build_Mode: StoreUpload
Configuration: ${{ matrix.configuration }}
Comment on lines +106 to +108
# Remove the pfx
- name: Remove the pfx
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants