|
9 | 9 | jobs: |
10 | 10 |
|
11 | 11 | build: |
12 | | - |
13 | | - permissions: |
14 | | - contents: write |
15 | | - pull-requests: write |
16 | | - |
17 | 12 | runs-on: windows-latest |
18 | | - |
| 13 | + |
19 | 14 | env: |
20 | 15 | Solution_Path: ContextMenuManager.sln |
21 | 16 | Project_Path: ContextMenuManager\ContextMenuManager.csproj |
22 | 17 |
|
23 | 18 | steps: |
24 | | - |
25 | 19 | # Checkout codes |
26 | 20 | - name: Checkout |
27 | 21 | uses: actions/checkout@v5 |
28 | 22 |
|
29 | | - # Install the .NET Core workload |
30 | | - # - name: Setup .NET |
31 | | - # uses: actions/setup-dotnet@v4 |
32 | | - # with: |
33 | | - # dotnet-version: | |
34 | | - # 9.0.x |
35 | | - |
36 | | - # Restore dependencies for entire solution |
| 23 | + # Restore NuGet packages (for .NET Framework projects) |
37 | 24 | - name: Restore dependencies |
38 | | - run: msbuild restore ${{ env.Solution_Path }} |
| 25 | + run: nuget restore ${{ env.Solution_Path }} |
39 | 26 |
|
40 | | - # Build the entire solution |
| 27 | + # Build the solution with MSBuild |
41 | 28 | - name: Build |
42 | 29 | run: msbuild ${{ env.Solution_Path }} /p:Configuration=Release |
43 | 30 |
|
44 | | - # Execute all unit tests in the solution |
45 | | - - name: Execute unit tests |
46 | | - run: msbuild ${{ env.Solution_Path }} /p:Configuration=Release /t:Test |
47 | | - |
48 | | - # Run the build task |
49 | | - - name: Run build task |
50 | | - run: msbuild ${{ env.Project_Path }} /p:Configuration=Release |
| 31 | + # (Optional) Run tests if you have MSTest/NUnit/xUnit for .NET Framework |
| 32 | + # - name: Execute unit tests |
| 33 | + # run: vstest.console.exe "**\bin\Release\*test*.dll" |
51 | 34 |
|
52 | | - # Upload the Build package |
| 35 | + # Upload build artifact |
53 | 36 | - name: Upload Build package |
54 | 37 | uses: actions/upload-artifact@v4 |
55 | 38 | with: |
56 | 39 | path: | |
57 | | - ContextMenuManager/bin/Release/ContextMenuManager.exe |
| 40 | + ContextMenuManager\bin\Release\ContextMenuManager.exe |
58 | 41 | compression-level: 0 |
0 commit comments