cloudflare/cloudflared
Publicmirrored from https://github.com/cloudflare/cloudflaredAvailable
.ci/scripts/windows/builds.ps1
24lines · modecode
| 1 | Set-StrictMode -Version Latest |
| 2 | $ErrorActionPreference = "Stop" |
| 3 | $ProgressPreference = "SilentlyContinue" |
| 4 | |
| 5 | $env:TARGET_OS = "windows" |
| 6 | $env:LOCAL_OS = "windows" |
| 7 | |
| 8 | New-Item -Path ".\artifacts" -ItemType Directory |
| 9 | |
| 10 | Write-Output "Building for amd64" |
| 11 | $env:TARGET_ARCH = "amd64" |
| 12 | $env:LOCAL_ARCH = "amd64" |
| 13 | $env:CGO_ENABLED = 1 |
| 14 | & make cloudflared |
| 15 | if ($LASTEXITCODE -ne 0) { throw "Failed to build cloudflared for amd64" } |
| 16 | copy .\cloudflared.exe .\artifacts\cloudflared-windows-amd64.exe |
| 17 | |
| 18 | Write-Output "Building for 386" |
| 19 | $env:TARGET_ARCH = "386" |
| 20 | $env:LOCAL_ARCH = "386" |
| 21 | $env:CGO_ENABLED = 0 |
| 22 | & make cloudflared |
| 23 | if ($LASTEXITCODE -ne 0) { throw "Failed to build cloudflared for 386" } |
| 24 | copy .\cloudflared.exe .\artifacts\cloudflared-windows-386.exe |