Skip to content

Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic

added local workflow release , WIP build optimization - add strip, link optimization for C #35

Sourav Kalal9edfd9acccc9
diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml
new file mode 100644
index 0000000..f3b1dfc
--- /dev/null
+++ b/.github/workflows/release-windows.yml
@@ -0,0 +1,53 @@
+name: Release ProxyBridge Windows
+
+on:
+ release:
+ types: [created]
+
+jobs:
+ build-and-release:
+ runs-on: self-hosted
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: '9.0.x'
+
+ - name: Verify WinDivert installation
+ run: |
+ if (Test-Path "C:\WinDivert-2.2.2-A") {
+ Write-Host "WinDivert found at C:\WinDivert-2.2.2-A"
+ } else {
+ Write-Error "WinDivert not found. Please install WinDivert 2.2.2-A at C:\WinDivert-2.2.2-A"
+ exit 1
+ }
+ shell: pwsh
+
+ - name: Build and sign project
+ run: .\Windows\compile.ps1
+ shell: pwsh
+
+ - name: List built files
+ run: |
+ Write-Host "`nBuild artifacts:"
+ Get-ChildItem Windows/output -Recurse | ForEach-Object {
+ $size = [math]::Round($_.Length/1MB, 2)
+ Write-Host " $($_.Name) - $size MB"
+ }
+ shell: pwsh
+
+ - name: Upload installer to release
+ uses: softprops/action-gh-release@v1
+ with:
+ files: Windows/output/ProxyBridge-Setup-*.exe
+
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: ProxyBridge-Release-${{ github.event.release.tag_name }}
+ path: Windows/output/
+ retention-days: 90
diff --git a/Windows/compile.ps1 b/Windows/compile.ps1
index 1ed6f04..dd3a418 100644
--- a/Windows/compile.ps1
+++ b/Windows/compile.ps1
@@ -48,11 +48,11 @@ function Compile-MSVC {
}
}
- $cmd = "cl.exe /nologo /O2 /W3 /D_CRT_SECURE_NO_WARNINGS /DPROXYBRIDGE_EXPORTS " +
+ $cmd = "cl.exe /nologo /O2 /GL /W3 /D_CRT_SECURE_NO_WARNINGS /DPROXYBRIDGE_EXPORTS " +
"/I`"$WinDivertPath\include`" " +
"$SourcePath\$SourceFile " +
"/LD " +
- "/link /LIBPATH:`"$WinDivertPath\$Arch`" " +
+ "/link /LTCG /OPT:REF /OPT:ICF /DEBUG:NONE /LIBPATH:`"$WinDivertPath\$Arch`" " +
"WinDivert.lib ws2_32.lib iphlpapi.lib " +
"/OUT:$OutputDLL"
@@ -77,7 +77,7 @@ function Compile-GCC {
Write-Host "GCC found: $($gccVersion[0])" -ForegroundColor Cyan
- $cmd = "gcc -shared -O2 -Wall -D_WIN32_WINNT=0x0601 -DPROXYBRIDGE_EXPORTS " +
+ $cmd = "gcc -shared -O2 -flto -s -Wall -D_WIN32_WINNT=0x0601 -DPROXYBRIDGE_EXPORTS " +
"-I`"$WinDivertPath\include`" " +
"$SourcePath\$SourceFile " +
"-L`"$WinDivertPath\$Arch`" " +
@@ -155,6 +155,15 @@ if ($Compiler -eq 'auto') {
if ($success) {
Write-Host "`nCompilation SUCCESSFUL!" -ForegroundColor Green
+ Write-Host "`nCleaning up intermediate files..." -ForegroundColor Yellow
+ $intermediateFiles = @("*.obj", "*.exp", "*.lib", "ProxyBridge.obj")
+ foreach ($pattern in $intermediateFiles) {
+ Get-ChildItem -Path . -Filter $pattern -ErrorAction SilentlyContinue | ForEach-Object {
+ Remove-Item $_.FullName -Force
+ Write-Host " Removed: $($_.Name)" -ForegroundColor Gray
+ }
+ }
+
Write-Host "`nMoving files to output directory..." -ForegroundColor Green
Move-Item $OutputDLL -Destination $OutputDir -Force
Write-Host " Moved: $OutputDLL -> $OutputDir\" -ForegroundColor Gray