# Build StreamCore Edge Agent for Windows # Prerequisites: Go 1.19+ param( [string]$Platform = "windows" ) $VERSION = if ($env:VERSION) { $env:VERSION } else { "0.1.0" } $OUTDIR = "dist" $APP = "streamcore-edge" $env:GO111MODULE = "on" $env:GOPROXY = if ($env:GOPROXY) { $env:GOPROXY } else { "https://goproxy.cn,direct" } if (-not (Test-Path $OUTDIR)) { New-Item -ItemType Directory -Path $OUTDIR | Out-Null } if ($Platform -eq "windows") { Write-Host "Building Windows (amd64)..." $env:GOOS = "windows" $env:GOARCH = "amd64" $env:CGO_ENABLED = "0" go build -ldflags "-s -w -H windowsgui -X main.Version=$VERSION" -o "$OUTDIR/$APP-windows-amd64.exe" . Write-Host " -> $OUTDIR/$APP-windows-amd64.exe" } else { Write-Host "Usage: .\build.ps1 [windows]" } Write-Host "Done."