mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
feat: Add build scripts, refactor for binary embedding
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
set "GOARCH=amd64"
|
||||
set "OUTPUT_DIR=./bin"
|
||||
|
||||
set "GO_FILE_PATH=./main/main.go"
|
||||
set "PROGRAM_NAME=GohCMS"
|
||||
|
||||
REM Compile for Windows
|
||||
set "GOOS=windows"
|
||||
go build -o "%OUTPUT_DIR%\%PROGRAM_NAME%_windows.exe" "%GO_FILE_PATH%"
|
||||
if %errorlevel% neq 0 (
|
||||
echo Compilation for Windows failed.
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
|
||||
REM Compile for Linux
|
||||
set "GOOS=linux"
|
||||
go build -o "%OUTPUT_DIR%\%PROGRAM_NAME%_linux" "%GO_FILE_PATH%"
|
||||
if %errorlevel% neq 0 (
|
||||
echo Compilation for Linux failed.
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
|
||||
REM Compile for macOS
|
||||
set "GOOS=darwin"
|
||||
go build -o "%OUTPUT_DIR%\%PROGRAM_NAME%_darwin" "%GO_FILE_PATH%"
|
||||
if %errorlevel% neq 0 (
|
||||
echo Compilation for macOS failed.
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
|
||||
echo Compilation successful for all platforms.
|
||||
|
||||
endlocal
|
||||
Reference in New Issue
Block a user