Fix build workflow #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| runs-on: windows-latest | |
| env: | |
| Solution_Path: ContextMenuManager.sln | |
| Project_Path: ContextMenuManager\ContextMenuManager.csproj | |
| steps: | |
| # Checkout codes | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| # Install the .NET Core workload | |
| # - name: Setup .NET | |
| # uses: actions/setup-dotnet@v4 | |
| # with: | |
| # dotnet-version: | | |
| # 9.0.x | |
| # Restore dependencies for entire solution | |
| - name: Restore dependencies | |
| run: msbuild restore ${{ env.Solution_Path }} | |
| # Build the entire solution | |
| - name: Build | |
| run: msbuild ${{ env.Solution_Path }} /p:Configuration=Release | |
| # Execute all unit tests in the solution | |
| - name: Execute unit tests | |
| run: msbuild ${{ env.Solution_Path }} /p:Configuration=Release /t:Test | |
| # Run the build task | |
| - name: Run build task | |
| run: msbuild ${{ env.Project_Path }} /p:Configuration=Release | |
| # Upload the Build package | |
| - name: Upload Build package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: | | |
| ContextMenuManager/bin/Release/ContextMenuManager.exe | |
| compression-level: 0 |