Refactor the plugin to make it easier to maintain #16
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: ci | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: setup NuGet | |
| uses: nuget/setup-nuget@v2 | |
| - name: restore packages | |
| run: nuget restore MBRC.sln -OutputDirectory packages -NonInteractive | |
| - name: check code formatting | |
| run: | | |
| echo "Checking code formatting..." | |
| echo "Running dotnet format --exclude=firewall-utility --verify-no-changes" | |
| dotnet format --exclude="firewall-utility" --verify-no-changes --verbosity normal | |
| if ($LASTEXITCODE -ne 0) { | |
| echo "❌ Code formatting issues found! Run 'dotnet format --exclude=firewall-utility' to fix them." | |
| echo "Note: Some analyzer warnings (CA####) are expected and don't affect formatting." | |
| exit 1 | |
| } | |
| echo "✅ Code formatting is clean!" | |
| - name: build with strict analysis | |
| run: | | |
| echo "🔍 Building with strict static analysis (warnings as errors)..." | |
| msbuild MBRC.sln /p:Configuration="Release" /p:MSBuildCI="true" /m /v:M /fl /nr:false | |
| - name: static analysis passed | |
| run: | | |
| echo "✅ Static Analysis Passed!" | |
| echo "All critical analyzer rules passed validation." | |
| echo "Build completed with only low-priority warnings (if any)." | |
| - name: copy to dist | |
| run: | | |
| mkdir -p build/dist | |
| cp build/bin/plugin/Release/mb_remote.dll build/dist | |
| cp build/bin/firewall-utility/Release/firewall-utility.exe build/dist | |
| cp LICENSE build/dist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: mbrc-plugin-dev | |
| path: build/dist | |