tooldown/build.bat

45 lines
1.0 KiB
Batchfile
Raw Normal View History

@echo off
REM ����Go�������ļ���������Ŀ¼
set SOURCE_FILE=main.go
set OUTPUT_DIR=build
REM �����汾��
2025-01-22 16:23:25 +08:00
set VERSION=v1.1
REM �����Ƿ���������Ŀ¼�������������򴴽�
if not exist %OUTPUT_DIR% (
mkdir %OUTPUT_DIR%
)
REM ���� 32 λ Windows �汾
echo Building 32-bit Windows version...
set GOOS=windows
set GOARCH=386
go build -o %OUTPUT_DIR%\tooldown_%VERSION%.win.x86.exe %SOURCE_FILE%
if %ERRORLEVEL% neq 0 (
echo Failed to build 32-bit Windows version.
exit /b 1
)
REM ���� 64 λ Windows �汾
echo Building 64-bit Windows version...
set GOARCH=amd64
go build -o %OUTPUT_DIR%\tooldown_%VERSION%.win.x64.exe %SOURCE_FILE%
if %ERRORLEVEL% neq 0 (
echo Failed to build 64-bit Windows version.
exit /b 1
)
REM ���� 64 λ Linux �汾
echo Building 64-bit Linux version...
set GOOS=linux
set GOARCH=amd64
go build -o %OUTPUT_DIR%\tooldown_%VERSION%.linux.x64 %SOURCE_FILE%
if %ERRORLEVEL% neq 0 (
echo Failed to build 64-bit Linux version.
exit /b 1
)
echo All builds completed successfully!
exit /b 0