Add Windows build support and fix Windows compatibility issues- Add build-windows.ps1 PowerShell script for Windows builds- Add BUILD-WINDOWS.md documentation for Windows users - Update build.sh to include Windows AMD64 and .exe extensions- Fix util/util.go Windows path handling (use filepath instead of path)- Fix error logging format (%v instead of %w)- Support Windows AMD64, 386, and ARM64 architectures
This commit is contained in:
34
build-windows.ps1
Normal file
34
build-windows.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
# Build script for Windows
|
||||
# This script builds Geek-life for different Windows architectures
|
||||
|
||||
Write-Host "Building Geek-life for Windows..." -ForegroundColor Green
|
||||
|
||||
# Create builds directory if it doesn't exist
|
||||
if (!(Test-Path "builds")) {
|
||||
New-Item -ItemType Directory -Path "builds"
|
||||
}
|
||||
|
||||
# Build for Windows AMD64 (64-bit)
|
||||
Write-Host "Building for Windows AMD64..." -ForegroundColor Yellow
|
||||
$env:GOOS="windows"
|
||||
$env:GOARCH="amd64"
|
||||
go build -ldflags="-s -w" -o builds/geek-life_windows-amd64.exe ./app
|
||||
|
||||
# Build for Windows 386 (32-bit)
|
||||
Write-Host "Building for Windows 386..." -ForegroundColor Yellow
|
||||
$env:GOOS="windows"
|
||||
$env:GOARCH="386"
|
||||
go build -ldflags="-s -w" -o builds/geek-life_windows-386.exe ./app
|
||||
|
||||
# Build for Windows ARM64
|
||||
Write-Host "Building for Windows ARM64..." -ForegroundColor Yellow
|
||||
$env:GOOS="windows"
|
||||
$env:GOARCH="arm64"
|
||||
go build -ldflags="-s -w" -o builds/geek-life_windows-arm64.exe ./app
|
||||
|
||||
Write-Host "Build completed!" -ForegroundColor Green
|
||||
Write-Host "Generated files:" -ForegroundColor Cyan
|
||||
Get-ChildItem builds/geek-life_windows*.exe | Select-Object Name, Length | Format-Table -AutoSize
|
||||
|
||||
Write-Host "`nTo run the application:" -ForegroundColor Yellow
|
||||
Write-Host " .\builds\geek-life_windows-amd64.exe" -ForegroundColor White
|
||||
Reference in New Issue
Block a user