Skip to content

Commit

Permalink
增加 windows编译增加打包编译文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun committed Apr 10, 2023
1 parent 3a224fa commit 10419f9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
@REM 请提前搭建好node.js环境和go环境
@REM 请将前端项目文件拉取到本目录中,并将项目文件夹重命名为web

set filenameZip=li-calendar_windows.zip
set filename=li-calendar.exe
cd web
call npm run build
rd ..\assets\frontend
xcopy .\dist\ ..\assets\frontend /s /i /y
cd ..\
go-bindata-assetfs -o=assets/bindata.go -pkg=assets assets/...
go build -o li-calendar.exe --ldflags="-X main.RunMode=release" main.go
echo "li-calendar.exe compilation is complete!"
go build -o %filename% --ldflags="-X main.RunMode=release" main.go


REM 打包文件
powershell Compress-Archive %filename% %filenameZip%

REM 删除原始文件
del %filename%

REM 返回上一级目录,进入父文件夹
cd ..
echo "%filenameZip% compilation is complete!"

0 comments on commit 10419f9

Please sign in to comment.