-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
119 lines (103 loc) · 2.91 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
SET name=SSLCertificateSplittingTool
SET version=1.0.0
RD /S /Q bin
MKDIR bin
COPY README.md bin\
COPY ico\icon.png bin\
COPY %name%.desktop bin\
SET CGO_ENABLED=0
SET GOOS=windows
ECHO Compiling Windows x86
SET GOARCH=386
go generate
MKDIR bin\%name%_windows-x86
go build -o bin\%name%_windows-x86\%name%.exe
COPY README.md bin\%name%_windows-x86\
DEL /Q *.syso
ECHO Compiling Windows x64
SET GOARCH=amd64
go generate
MKDIR bin\%name%_windows-x64
go build -o bin\%name%_windows-x64\%name%.exe
COPY README.md bin\%name%_windows-x64\
DEL /Q *.syso
ECHO Compiling Windows ARM32
SET GOARCH=arm
go generate
MKDIR bin\%name%_windows-arm32
go build -o bin\%name%_windows-arm32\%name%.exe
COPY README.md bin\%name%_windows-arm32\
DEL /Q *.syso
ECHO Compiling Windows ARM64
SET GOARCH=arm64
go generate
MKDIR bin\%name%_windows-arm64
go build -o bin\%name%_windows-arm64\%name%.exe
COPY README.md bin\%name%_windows-arm64\
DEL /Q *.syso
SET GOOS=darwin
MKDIR bin\%name%.app
MKDIR bin\%name%.app\Contents
COPY Info.plist bin\%name%.app\Contents
MKDIR bin\%name%.app\Contents\Resources
COPY ico\icon.icns bin\%name%.app\Contents\Resources
MKDIR bin\%name%.app\Contents\MacOS
MKDIR bin\%name%_macos-x64
XCOPY bin\%name%.app bin\%name%_macos-x64\%name%.app /E /I
MKDIR bin\%name%_macos-arm64
XCOPY bin\%name%.app bin\%name%_macos-arm64\%name%.app /E /I
RD /S /Q bin\%name%.app
ECHO Compiling macOS x64
SET GOARCH=amd64
go build -o bin\%name%_macos-x64\%name%
COPY README.md bin\%name%_macos-x64\
COPY bin\%name%_macos-x64\%name% bin\%name%_macos-x64\%name%.app\Contents\MacOS\
ECHO Compiling macOS ARM64
SET GOARCH=arm64
go build -o bin\%name%_macos-arm64\%name%
COPY README.md bin\%name%_macos-arm64\
COPY bin\%name%_macos-arm64\%name% bin\%name%_macos-arm64\%name%.app\Contents\MacOS\
SET GOOS=linux
ECHO Compiling Linux x86
SET GOARCH=386
MKDIR bin\%name%_linux-x86
go build -o bin\%name%_linux-x86\%name%
COPY README.md bin\%name%_linux-x86\
COPY ico\icon.png bin\%name%_linux-x86\
COPY %name%.desktop bin\%name%_linux-x86\
ECHO Compiling Linux x64
SET GOARCH=amd64
MKDIR bin\%name%_linux-x64
go build -o bin\%name%_linux-x64\%name%
COPY README.md bin\%name%_linux-x64\
COPY ico\icon.png bin\%name%_linux-x64\
COPY %name%.desktop bin\%name%_linux-x64\
ECHO Compiling Linux ARM32
SET GOARCH=arm
MKDIR bin\%name%_linux-arm32
go build -o bin\%name%_linux-arm32\%name%
COPY README.md bin\%name%_linux-arm32\
COPY ico\icon.png bin\%name%_linux-arm32\
COPY %name%.desktop bin\%name%_linux-arm32\
ECHO Compiling Linux ARM64
SET GOARCH=arm64
MKDIR bin\%name%_linux-arm64
go build -o bin\%name%_linux-arm64\%name%
COPY README.md bin\%name%_linux-arm64\
COPY ico\icon.png bin\%name%_linux-arm64\
COPY %name%.desktop bin\%name%_linux-arm64\
CD bin
for /d %%D in (*) do (
7z a -tzip -mx=9 "%%D.zip" "%%D"
RD /S /Q "%%D"
)
DEL *.md
DEL *.png
DEL *.desktop
openssl sha256 %name%_*.zip >%name%_%version%.sha256.txt
CD ..
SET name=
SET version=
SET CGO_ENABLED=
SET GOOS=
SET GOARCH=