-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows.ps1
56 lines (50 loc) · 1.47 KB
/
windows.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$file_name = Read-Host "file_name "
$to = $args[0]
if($to -eq $null) {
$to = "all"
}
if($to -eq "linux_amd64" -or $to -eq "all") {
Write-Host "linux amd64"
$env:GOOS = "linux"
$env:GOARCH = "amd64"
$env:CGO_ENABLED = 0
go build $file_name.go
Remove-Item ".\bin\$file_name.amd64.bin"
Move-Item "opennamu" ".\bin\$file_name.amd64.bin"
}
if($to -eq "linux_arm64" -or $to -eq "all") {
Write-Host "linux arm64"
$env:GOOS = "linux"
$env:GOARCH = "arm64"
$env:CGO_ENABLED = 0
go build $file_name.go
Remove-Item ".\bin\$file_name.arm64.bin"
Move-Item "opennamu" ".\bin\$file_name.arm64.bin"
}
if($to -eq "windows_amd64" -or $to -eq "all") {
Write-Host "windows amd64"
$env:GOOS = "windows"
$env:GOARCH = "amd64"
$env:CGO_ENABLED = 0
go build $file_name.go
Remove-Item ".\bin\$file_name.amd64.exe"
Move-Item "opennamu.exe" ".\bin\$file_name.amd64.exe"
}
if($to -eq "windows_arm64" -or $to -eq "all") {
Write-Host "windows arm64"
$env:GOOS = "windows"
$env:GOARCH = "arm64"
$env:CGO_ENABLED = 0
go build $file_name.go
Remove-Item ".\bin\$file_name.arm64.exe"
Move-Item "opennamu.exe" ".\bin\$file_name.arm64.exe"
}
if($to -eq "mac_arm64" -or $to -eq "all") {
Write-Host "mac arm64"
$env:GOOS = "darwin"
$env:GOARCH = "arm64"
$env:CGO_ENABLED = 0
go build $file_name.go
Remove-Item ".\bin\$file_name.mac.arm64.bin"
Move-Item "opennamu" ".\bin\$file_name.mac.arm64.bin"
}