-
Notifications
You must be signed in to change notification settings - Fork 170
/
Copy pathbuild.bat
64 lines (57 loc) · 1.92 KB
/
build.bat
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
57
58
59
60
61
62
63
64
@echo off
setlocal
:: 编译 Linux ARM32
set GOOS=linux
set GOARCH=arm
set GOARM=7
set OUTPUT_DIR=.\builds\PandoraHelper-%1-%GOOS%-%GOARCH%
mkdir %OUTPUT_DIR%
mkdir %OUTPUT_DIR%\data
go build -trimpath -ldflags="-s -w" -o %OUTPUT_DIR%\PandoraHelper .\cmd\server\main.go
upx %OUTPUT_DIR%\PandoraHelper
copy .\data\config.json "%OUTPUT_DIR%"\data\
:: 编译 Linux ARM64
set GOOS=linux
set GOARCH=arm64
set OUTPUT_DIR=.\builds\PandoraHelper-%1-%GOOS%-%GOARCH%
mkdir %OUTPUT_DIR%
mkdir %OUTPUT_DIR%\data
go build -trimpath -ldflags="-s -w" -o %OUTPUT_DIR%\PandoraHelper .\cmd\server\main.go
upx %OUTPUT_DIR%\PandoraHelper
copy .\data\config.json "%OUTPUT_DIR%"\data\
:: 编译为Linux 64位
set GOOS=linux
set GOARCH=amd64
set OUTPUT_DIR=.\builds\PandoraHelper-%1-%GOOS%-%GOARCH%
mkdir %OUTPUT_DIR%
mkdir %OUTPUT_DIR%\data
go build -trimpath -ldflags="-s -w" -o %OUTPUT_DIR%\PandoraHelper .\cmd\server\main.go
upx %OUTPUT_DIR%\PandoraHelper
copy .\data\config.json "%OUTPUT_DIR%"\data\
:: 编译 Windows 64 位
set GOOS=windows
set GOARCH=amd64
set OUTPUT_DIR=.\builds\PandoraHelper-%1-%GOOS%-%GOARCH%
mkdir %OUTPUT_DIR%
mkdir %OUTPUT_DIR%\data
go build -trimpath -ldflags="-s -w" -o %OUTPUT_DIR%\PandoraHelper.exe .\cmd\server\main.go
upx %OUTPUT_DIR%\PandoraHelper.exe
copy .\data\config.json "%OUTPUT_DIR%"\data\
:: 编译为macOS 64位
set GOOS=darwin
set GOARCH=amd64
set OUTPUT_DIR=.\builds\PandoraHelper-%1-%GOOS%-%GOARCH%
mkdir %OUTPUT_DIR%
mkdir %OUTPUT_DIR%\data
go build -trimpath -ldflags="-s -w" -o %OUTPUT_DIR%\PandoraHelper .\cmd\server\main.go
copy .\data\config.json "%OUTPUT_DIR%"\data\
:: 编译为freebsd
set GOOS=freebsd
set GOARCH=amd64
set OUTPUT_DIR=.\builds\PandoraHelper-%1-%GOOS%-%GOARCH%
mkdir %OUTPUT_DIR%
mkdir %OUTPUT_DIR%\data
go build -trimpath -ldflags="-s -w" -o %OUTPUT_DIR%\PandoraHelper .\cmd\server\main.go
upx %OUTPUT_DIR%\PandoraHelper
copy .\data\config.json "%OUTPUT_DIR%"\data\
echo Compilation and compression complete.