-
-
Notifications
You must be signed in to change notification settings - Fork 48
Create dotnet-desktop.yml #318
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new GitHub Actions workflow file named Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant Runner
participant MSBuild
participant dotnet
participant ArtifactStore
Developer->>GitHub: Push or PR to main
GitHub->>Runner: Trigger workflow
Runner->>GitHub: Checkout repository
Runner->>dotnet: Install .NET SDK 8.0.x
Runner->>MSBuild: Setup MSBuild
Runner->>dotnet: Run tests (dotnet test)
Runner->>MSBuild: Restore solution
Runner->>Runner: Decode signing certificate (from secret)
Runner->>MSBuild: Build & package WAP project (signing with certificate)
Runner->>Runner: Remove certificate file
Runner->>ArtifactStore: Upload MSIX package artifact
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (4)
.github/workflows/dotnet-desktop.yml (4)
41-46
: Add a manual trigger for on-demand runs.Currently the workflow only triggers on push and pull_request to
main
. Consider addingworkflow_dispatch
so you can run it manually from the Actions tab:on: workflow_dispatch:
81-83
: Scope tests to the intended project and configuration.Instead of
dotnet test
on the entire repo, target the defined test project and matrix configuration:- run: dotnet test + run: dotnet test ${{ env.Test_Project_Path }} --configuration ${{ matrix.configuration }}This will run only your unit tests and respect the Debug/Release matrix.
84-89
: Consider usingdotnet restore
over MSBuild restore.For .NET Core projects,
dotnet restore
provides cross-platform consistency and richer output:- run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + run: dotnet restore ${{ env.Solution_Name }} --configuration ${{ matrix.configuration }}
90-96
: Verify secrets and explicitly set the shell.
- Make sure the secrets
Base64_Encoded_Pfx
andPfx_Key
exist in this repo’s Settings → Secrets.- Explicitly declare the shell to ensure your PowerShell script runs as expected:
- name: Decode the pfx shell: pwsh run: | $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") ...
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. | ||
|
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.
Critical: Replace all placeholder env variables.
The env
section uses placeholders (your-solution-name
, your-test-project-path
, etc.). If these aren’t updated to actual file names/paths, the workflow will fail immediately.
Please replace:
Solution_Name
→ e.g.MyWpfApp.sln
Test_Project_Path
→ e.g.MyWpfApp.Tests/MyWpfApp.Tests.csproj
Wap_Project_Directory
→ e.g.MyWpfApp.Package
Wap_Project_Path
→ e.g.MyWpfApp.Package/MyWpfApp.Package.wapproj
🤖 Prompt for AI Agents
In .github/workflows/dotnet-desktop.yml around lines 58 to 63, the environment
variables are set to placeholder values that will cause the workflow to fail.
Replace these placeholders with the actual solution and project names/paths
relevant to your project, such as setting Solution_Name to your real solution
file name (e.g., MyWpfApp.sln), Test_Project_Path to the correct test project
file path, Wap_Project_Directory to the actual Wap project directory name, and
Wap_Project_Path to the correct Wap project file path.
- 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 }} | ||
|
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.
Critical: Pass the AppxBundlePlatforms
parameter.
You define Appx_Bundle_Platforms
but never pass it to MSBuild. Without it, packaging for x86|x64 won’t be honored. Apply this diff:
- 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 }}
+ run: msbuild $env:Wap_Project_Path \
+ /p:Configuration=$env:Configuration \
+ /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode \
+ /p:AppxBundle=$env:Appx_Bundle \
+ /p:AppxBundlePlatforms=$env:Appx_Bundle_Platforms \
+ /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx \
+ /p:PackageCertificatePassword=${{ secrets.Pfx_Key }}
🤖 Prompt for AI Agents
In .github/workflows/dotnet-desktop.yml around lines 98 to 105, the environment
variable Appx_Bundle_Platforms is defined but not passed as a parameter to the
msbuild command. To fix this, add the parameter
/p:AppxBundlePlatforms=$env:Appx_Bundle_Platforms to the msbuild run command so
that the specified platforms (x86|x64) are correctly used during packaging.
@Tan671 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ), 1. Definitions. “Code” means the computer software code, whether in human-readable or machine-executable form, “Project” means any of the projects owned or managed by .NET Foundation and offered under a license “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any “Submission” means the Code and any other copyrightable material Submitted by You, including any 2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any 3. Originality of Work. You represent that each of Your Submissions is entirely Your 4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else 5. Licenses. a. Copyright License. You grant .NET Foundation, and those who receive the Submission directly b. Patent License. You grant .NET Foundation, and those who receive the Submission directly or c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. 6. Representations and Warranties. You represent that You are legally entitled to grant the above 7. Notice to .NET Foundation. You agree to notify .NET Foundation in writing of any facts or 8. Information about Submissions. You agree that contributions to Projects and information about 9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and 10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and .NET Foundation dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1. |
@Tan671 please motivate this PR and place a description. |
Description
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist:
Summary by CodeRabbit