-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.bat
More file actions
47 lines (37 loc) · 1.27 KB
/
build.bat
File metadata and controls
47 lines (37 loc) · 1.27 KB
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
@echo off
setlocal
set VERSION=1.0.0
set BUILD_DIR=build
:: 创建构建目录
if not exist %BUILD_DIR% mkdir %BUILD_DIR%
:: 清理旧的构建文件
echo Cleaning build directory...
del /Q %BUILD_DIR%\*
:: Windows 构建
echo Building for Windows/amd64...
set GOOS=windows
set GOARCH=amd64
go build -o "%BUILD_DIR%\mcp-alapi-cn-%VERSION%-windows-amd64.exe" -ldflags="-s -w" main.go
echo Building for Windows/arm64...
set GOOS=windows
set GOARCH=arm64
go build -o "%BUILD_DIR%\mcp-alapi-cn-%VERSION%-windows-arm64.exe" -ldflags="-s -w" main.go
:: Linux 构建
echo Building for Linux/amd64...
set GOOS=linux
set GOARCH=amd64
go build -o "%BUILD_DIR%\mcp-alapi-cn-%VERSION%-linux-amd64" -ldflags="-s -w" main.go
echo Building for Linux/arm64...
set GOOS=linux
set GOARCH=arm64
go build -o "%BUILD_DIR%\mcp-alapi-cn-%VERSION%-linux-arm64" -ldflags="-s -w" main.go
:: macOS 构建
echo Building for macOS/amd64...
set GOOS=darwin
set GOARCH=amd64
go build -o "%BUILD_DIR%\mcp-alapi-cn-%VERSION%-darwin-amd64" -ldflags="-s -w" main.go
echo Building for macOS/arm64...
set GOOS=darwin
set GOARCH=arm64
go build -o "%BUILD_DIR%\mcp-alapi-cn-%VERSION%-darwin-arm64" -ldflags="-s -w" main.go
echo Build complete! Output files are in the build directory.