45 lines
1.0 KiB
Batchfile
45 lines
1.0 KiB
Batchfile
|
@echo off
|
||
|
REM ����Go�������ļ���������Ŀ¼
|
||
|
set SOURCE_FILE=main.go
|
||
|
set OUTPUT_DIR=build
|
||
|
|
||
|
REM �����汾��
|
||
|
set VERSION=v1.0
|
||
|
|
||
|
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
|